annotate lisp/gnus/message.el @ 71503:fa67beba36e1

(USE_MAC_TSM) [TARGET_API_MAC_CARBON]: Set default to 1.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 28 Jun 2006 08:30:32 +0000
parents 6ee457a7e830
children cbdca6c6638d 4094c5298ae1
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,
68230
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
4 ;; 2005, 2006 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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14 ;; any later version.
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63977
diff changeset
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63977
diff changeset
24 ;; Boston, MA 02110-1301, USA.
17493
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 ;;; Commentary:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
28 ;; This mode provides mail-sending facilities from within Emacs. It
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
29 ;; consists mainly of large chunks of code from the sendmail.el,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
30 ;; gnus-msg.el and rnewspost.el files.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
31
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
32 ;;; Code:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
33
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
34 (eval-when-compile
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
35 (require 'cl)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
36 (defvar 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
37 (defvar gnus-list-identifiers)) ; gnus-sum is required where necessary
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
38 (require 'canlock)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
39 (require 'mailheader)
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
40 (require 'gmm-utils)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
41 (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
42 ;; 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
43 ;; 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
44 ;; require mailabbrev here.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
45 (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
46 (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
47 (require 'mailabbrev))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
48 (require 'mail-parse)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
49 (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
50 (require 'rfc822)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
51 (eval-and-compile
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
52 (autoload 'gnus-find-method-for-group "gnus")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
53 (autoload 'nnvirtual-find-group-art "nnvirtual")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
54 (autoload 'gnus-group-decoded-name "gnus-group"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
55
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
56 (defgroup message '((user-mail-address custom-variable)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
57 (user-full-name custom-variable))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
58 "Mail and news message composing."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
59 :link '(custom-manual "(message)Top")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
60 :group 'mail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
61 :group 'news)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
62
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
63 (put 'user-mail-address 'custom-type 'string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
64 (put 'user-full-name 'custom-type 'string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
65
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
66 (defgroup message-various nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
67 "Various Message Variables."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
68 :link '(custom-manual "(message)Various Message Variables")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
69 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
70
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
71 (defgroup message-buffers nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
72 "Message Buffers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 :link '(custom-manual "(message)Message Buffers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
75
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
76 (defgroup message-sending nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
77 "Message Sending."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 :link '(custom-manual "(message)Sending Variables")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
79 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
80
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
81 (defgroup message-interface nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
82 "Message Interface."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
83 :link '(custom-manual "(message)Interface")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
86 (defgroup message-forwarding nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
87 "Message Forwarding."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
88 :link '(custom-manual "(message)Forwarding")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
89 :group 'message-interface)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
90
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
91 (defgroup message-insertion nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
92 "Message Insertion."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
93 :link '(custom-manual "(message)Insertion")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
94 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
95
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
96 (defgroup message-headers nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
97 "Message Headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
98 :link '(custom-manual "(message)Message Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
99 :group 'message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
100
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
101 (defgroup message-news nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
102 "Composing News Messages."
17493
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-mail nil
63977
093115a435b2 (message-various, message-buffers, message-sending, message-interface,
Juanma Barranquero <lekktu@gmail.com>
parents: 63480
diff changeset
106 "Composing Mail 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-faces nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
110 "Faces used for message composing."
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 :group 'faces)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 (defcustom message-directory "~/Mail/"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115 "*Directory from which all other mail file variables are derived."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117 :type 'directory)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
118
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
119 (defcustom message-max-buffers 10
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
120 "*How many buffers to keep before starting to kill them off."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
121 :group 'message-buffers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
122 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
123
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
124 (defcustom message-send-rename-function nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
125 "Function called to rename the buffer after sending it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
126 :group 'message-buffers
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
127 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
128
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
129 (defcustom message-fcc-handler-function 'message-output
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
130 "*A function called to save outgoing articles.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
131 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
132 article in. The default function is `message-output' which saves in Unix
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
133 mailbox format."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
134 :type '(radio (function-item message-output)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
135 (function :tag "Other"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
136 :group 'message-sending)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
137
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
138 (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
139 "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
140 :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
141 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
142 :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
143
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
144 (defcustom message-courtesy-message
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
145 "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
146 "*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
147 If the string contains the format spec \"%s\", the Newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
148 the article has been posted to will be inserted there.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
149 If this variable is nil, no such courtesy message will be added."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
150 :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
151 :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
152
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
153 (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
154 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
155 "*Regexp that matches headers to be removed in resent bounced mail."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
156 :group 'message-interface
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
157 :type 'regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
158
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
159 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
160 (defcustom message-from-style 'default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
161 "*Specifies how \"From\" headers look.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
162
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
163 If nil, they contain just the return address like:
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
164 king@grassland.com
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
165 If `parens', they look like:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
166 king@grassland.com (Elvis Parsley)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
167 If `angles', they look like:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
168 Elvis Parsley <king@grassland.com>
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
170 Otherwise, most addresses look like `angles', but they look like
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
171 `parens' if `angles' would need quoting and `parens' would not."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
172 :type '(choice (const :tag "simple" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
173 (const parens)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
174 (const angles)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
175 (const default))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
176 :group 'message-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
177
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
178 (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
179 "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
180 :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
181 :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
182 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
183
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
184 (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
185 (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
186 ;; 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
187 "*Controls what syntax checks should not be performed on outgoing posts.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
188 To disable checking of long signatures, for instance, add
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
189 `(signature . disabled)' to this list.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
190
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
191 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
192
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
193 Checks include `approved', `continuation-headers', `control-chars',
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
194 `empty', `existing-newsgroups', `from', `illegible-text',
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
195 `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
196 `multiple-headers', `new-text', `newsgroups', `quoting-style',
71398
6ee457a7e830 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 71379
diff changeset
197 `repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
198 `shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
199 and `valid-newsgroups'."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
200 :group 'message-news
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
201 :type '(repeat sexp)) ; Fixme: improve this
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
202
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
203 (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
204 From)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
205 "*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
206 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
207 `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
208 :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
209 :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
210 :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
211 :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
212 :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
213
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
214 (defcustom message-draft-headers '(References From)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
215 "*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
216 :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
217 :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
218 :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
219 :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
220 :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
221
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
222 (defcustom message-required-news-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
223 '(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
224 (optional . Organization)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
225 (optional . User-Agent))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
226 "*Headers to be generated or prompted for when posting an article.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
227 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
228 Message-ID. Organization, Lines, In-Reply-To, Expires, and
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
229 User-Agent are optional. If don't you want message to insert some
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
230 header, remove it from this list."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
231 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
232 :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
233 :link '(custom-manual "(message)Message Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
234 :type '(repeat sexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
235
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 (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
237 '(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
238 (optional . User-Agent))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
239 "*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
240 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
241 included. Organization and User-Agent are optional."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
242 :group 'message-mail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
243 :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
244 :link '(custom-manual "(message)Message Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
245 :type '(repeat sexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
246
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
247 (defcustom message-deletable-headers '(Message-ID Date Lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
248 "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
249 :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
250 :link '(custom-manual "(message)Message Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
251 :type 'sexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
252
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
253 (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
254 "^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
255 "*Regexp of headers to be removed unconditionally before posting."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
256 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
257 :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
258 :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
259 :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
260 (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
261 :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
262 (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
263 (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
264 regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
265
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
266 (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
267 "^[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
268 "*Regexp of headers to be removed unconditionally before mailing."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
269 :group 'message-mail
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)Mail Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
272 :type 'regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
273
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
274 (defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
275 "*Header lines matching this regexp will be deleted before posting.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
276 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
277 any confusion."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
278 :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
279 :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
280 :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
281 (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
282 :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
283 (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
284 (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
285 regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
286
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
287 (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
288 "^[ \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
289 "*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
290 :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
291 :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
292 :type 'regexp)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
293
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
294 ;;; 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
295
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
296 (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
297 "*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
298 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
299 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
300 `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
301 `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
302 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
303 used."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
304 :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
305 :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
306 (const :tag "always strip" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
307 (const ask))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
308 :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
309 :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
310
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
311 (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
312 "[ \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
313 "*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
314
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
315 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
316 `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
317 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
318 `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
319
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
320 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
321 :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
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 :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
324 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
325
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
326 (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
327 "[ \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
328 "*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
329
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
330 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
331 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
332 `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
333 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
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 ;;; 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
340
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
341 (defcustom message-mark-insert-begin
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
342 "--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
343 "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
344 :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
345 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
346 :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
347 :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
348
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
349 (defcustom message-mark-insert-end
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
350 "--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
351 "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
352 :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
353 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
354 :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
355 :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
356
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
357 (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
358 "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
359 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
360 :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
361 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
362 :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
363 :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
364
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
365 (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
366 "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
367 "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
368 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
369 :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
370 :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
371 :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
372 :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
373
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
374 ;;; 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
375 ;; 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
376 ;; 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
377
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
378 (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
379 "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
380 (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
381
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
382 (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
383 "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
384 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
385 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
386 `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
387 :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
388 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
389 :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
390
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
391 (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
392 "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
393 :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
394 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
395 :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
396
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
397 (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
398 "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
399 :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
400 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
401 :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
402
60390
d8ddb2b48062 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Miles Bader <miles@gnu.org>
parents: 60356
diff changeset
403 (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
404 "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
405 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
406 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
407 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
408 :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
409 :type 'function
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
410 :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
411
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
412 ;;; 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
413
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
414 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
415 (defcustom message-signature-separator "^-- *$"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
416 "Regexp matching the signature separator."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
417 :type 'regexp
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
418 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
419 :group 'message-various)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
420
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
421 (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
422 "*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
423 :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
424 :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
425 :group 'message-various)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
426
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
427 (defcustom message-interactive t
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
428 "Non-nil means when sending a message wait for and display errors.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
429 nil means let mailer mail back a message to report errors."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
430 :group 'message-sending
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
431 :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
432 :link '(custom-manual "(message)Sending Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
433 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
434
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
435 (defcustom message-generate-new-buffers 'unique
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
436 "*Non-nil means create a new message buffer whenever `message-setup' is called.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
437 If this is a function, call that function with three parameters: The type,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
438 the to address and the group name. (Any of these may be nil.) The function
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
439 should return the new buffer name."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
440 :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
441 :link '(custom-manual "(message)Message Buffers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
442 :type '(choice (const :tag "off" nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
443 (const :tag "unique" unique)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
444 (const :tag "unsent" unsent)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
445 (function fun)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
446
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
447 (defcustom message-kill-buffer-on-exit nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
448 "*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
449 :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
450 :link '(custom-manual "(message)Message Buffers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
451 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
452
33301
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
453 (eval-when-compile
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
454 (defvar gnus-local-organization))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
455 (defcustom message-user-organization
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
456 (or (and (boundp 'gnus-local-organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
457 (stringp gnus-local-organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
458 gnus-local-organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
459 (getenv "ORGANIZATION")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
460 t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
461 "*String to be used as an Organization header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
462 If t, use `message-user-organization-file'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
463 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
464 :type '(choice string
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
465 (const :tag "consult file" t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
466
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
467 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
468 (defcustom message-user-organization-file "/usr/lib/news/organization"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
469 "*Local news organization file."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
470 :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
471 :link '(custom-manual "(message)News Headers")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
472 :group 'message-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
473
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
474 (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
475 #'message-forward-subject-name-subject
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
476 "*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
477 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
478 successive function.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
479
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
480 The provided functions are:
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
481
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
482 * `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
483 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
484 * `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
485 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
486 * `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
487 to it."
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
488 :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
489 :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
490 :type '(radio (function-item message-forward-subject-author-subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
491 (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
492 (function-item message-forward-subject-name-subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
493 (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
494
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
495 (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
496 "*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
497 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
498 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
499 :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
500 :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
501 :type 'boolean)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
502
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
503 (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
504 "*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
505 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
506 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
507 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
508 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
509 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
510 digital signature."
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
511 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
512 :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
513 :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
514 (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
515 (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
516
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
517 (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
518 "*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
519 :group 'message-forwarding
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
520 :type 'boolean)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
521
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
522 (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
523 "*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
524 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
525 :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
526 :link '(custom-manual "(message)Forwarding")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
527 :type 'boolean)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
528
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
529 (defcustom message-ignored-resent-headers "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From "
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
530 "*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
531 :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
532 :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
533 :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
534 (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
535 :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
536 (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
537 (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
538 regexp))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
539
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
540 (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
541 "*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
542 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
543 :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
544 :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
545 (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
546 :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
547 (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
548 (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
549 regexp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
550
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551 (defcustom message-ignored-cited-headers "."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
552 "*Delete these headers from the messages you yank."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
553 :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
554 :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
555 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
556
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
557 (defcustom 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
558 (if (string-match "[[:digit:]]" "1") ;; support POSIX?
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
559 "\\([ \t]*[-_.[:word:]]+>+\\|[ \t]*[]>|}+]\\)+"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
560 ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
561 (let ((old-table (syntax-table))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
562 non-word-constituents)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
563 (set-syntax-table text-mode-syntax-table)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
564 (setq non-word-constituents
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
565 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
566 (if (string-match "\\w" "-") "" "-")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
567 (if (string-match "\\w" "_") "" "_")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
568 (if (string-match "\\w" ".") "" ".")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
569 (set-syntax-table old-table)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
570 (if (equal non-word-constituents "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
571 "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}+]\\)+"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
572 (concat "\\([ \t]*\\(\\w\\|["
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
573 non-word-constituents
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
574 "]\\)+>+\\|[ \t]*[]>|}+]\\)+"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
575 "*Regexp matching the longest possible citation prefix on a line."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
576 :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
577 :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
578 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
579 :type 'regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
580
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
581 (defcustom message-cancel-message "I am canceling my own article.\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
582 "Message to be inserted in the cancel message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
583 :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
584 :link '(custom-manual "(message)Canceling News")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
585 :type 'string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
586
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
587 ;; Useful to set in site-init.el
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
588 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
589 (defcustom message-send-mail-function 'message-send-mail-with-sendmail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
590 "Function to call to send the current buffer as mail.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
591 The headers should be delimited by a line whose contents match the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
592 variable `mail-header-separator'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
593
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
594 Valid values include `message-send-mail-with-sendmail' (the default),
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
595 `message-send-mail-with-mh', `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
596 `message-smtpmail-send-it', `smtpmail-send-it' and `feedmail-send-it'.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
597
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
598 See also `send-mail-function'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
599 :type '(radio (function-item message-send-mail-with-sendmail)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
600 (function-item message-send-mail-with-mh)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
601 (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
602 (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
603 (function-item smtpmail-send-it)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
604 (function-item feedmail-send-it)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
605 (function :tag "Other"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
606 :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
607 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
608 :group 'message-mail)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
609
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
610 (defcustom message-send-news-function 'message-send-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
611 "Function to call to send the current buffer as news.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
612 The headers should be delimited by a line whose contents match the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
613 variable `mail-header-separator'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
614 :group 'message-sending
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
615 :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
616 :link '(custom-manual "(message)News Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
617 :type 'function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
618
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
619 (defcustom message-reply-to-function nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
620 "If non-nil, function that should return a list of headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
621 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
622 and respond with new To and Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
623 :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
624 :link '(custom-manual "(message)Reply")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
625 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
626
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
627 (defcustom message-wide-reply-to-function nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
628 "If non-nil, function that should return a list of headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
629 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
630 and respond with new To and Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
631 :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
632 :link '(custom-manual "(message)Wide Reply")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
633 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
634
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
635 (defcustom message-followup-to-function nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
636 "If non-nil, function that should return a list of headers.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
637 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
638 and respond with new To and Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639 :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
640 :link '(custom-manual "(message)Followup")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
641 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643 (defcustom message-use-followup-to 'ask
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
644 "*Specifies what to do with Followup-To header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
645 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
646 query before using the \"poster\" value. If it is the symbol `ask',
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
647 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
648 `use', always use the value."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
649 :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
650 :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
651 :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
652 (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
653 (const use)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
654 (const ask)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
655
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
656 (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
657 "*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
658 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
659 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
660 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
661 :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
662 :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
663 :link '(custom-manual "(message)Mailing Lists")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
664 :type '(choice (const :tag "ignore" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
665 (const use)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
666 (const ask)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
667
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
668 (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
669 "*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
670 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
671 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
672 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
673 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
674 `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
675 :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
676 :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
677 :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
678 :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
679
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
680 (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
681 "*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
682 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
683 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
684 :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
685 :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
686 :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
687 :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
688
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
689 (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
690 "*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
691 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
692 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
693 `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
694 :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
695 :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
696 :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
697 :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
698
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
699 (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
700 "*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
701 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
702 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
703 `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
704 :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
705 :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
706 :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
707 :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
708
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
709 (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
710 "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
711 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
712 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
713 `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
714 :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
715 :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
716 :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
717 :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
718 (const never)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
719 (const ask)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
720
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
721 (defcustom message-sendmail-f-is-evil nil
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
722 "*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
723 Doing so would be even more evil than leaving it out."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
724 :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
725 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
726 :type 'boolean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
727
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
728 (defcustom message-sendmail-envelope-from nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
729 "*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
730 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
731 `header', use the From: header of the message."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
732 :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
733 :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
734 (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
735 (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
736 :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
737 :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
738
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
739 ;; qmail-related stuff
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
740 (defcustom message-qmail-inject-program "/var/qmail/bin/qmail-inject"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
741 "Location of the qmail-inject program."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
742 :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
743 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
744 :type 'file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
745
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
746 (defcustom message-qmail-inject-args nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
747 "Arguments passed to qmail-inject programs.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
748 This should be a list of strings, one string for each argument. It
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
749 may also be a function.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
750
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
751 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
752 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
753 might set this variable to '(\"-f\" \"you@some.where\")."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
754 :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
755 :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
756 :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
757 (repeat string)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
758
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
759 (defvar message-cater-to-broken-inn t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
760 "Non-nil means Gnus should not fold the `References' header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
761 Folding `References' makes ancient versions of INN create incorrect
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
762 NOV lines.")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
763
33301
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
764 (eval-when-compile
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
765 (defvar gnus-post-method)
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
766 (defvar gnus-select-method))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
767 (defcustom message-post-method
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
768 (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
769 (listp gnus-post-method)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
770 gnus-post-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
771 gnus-post-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
772 ((boundp 'gnus-select-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
773 gnus-select-method)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
774 (t '(nnspool "")))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
775 "*Method used to post news.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
776 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
777 variable isn't used."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
778 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
779 :group 'message-sending
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
780 ;; This should be the `gnus-select-method' widget, but that might
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
781 ;; create a dependence to `gnus.el'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
782 :type 'sexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
783
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
784 ;; 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
785 ;; 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
786 ;; 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
787 ;; 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
788 (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
789 "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
790 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
791 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
792 `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
793
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
794 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
795 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
796 will not have a visible effect for those headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
797 :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
798 :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
799 :type '(choice (const :tag "None" nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
800 (const :tag "References" '(references))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
801 (const :tag "All" t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
802 (repeat (sexp :tag "Header"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
803
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
804 (defcustom message-setup-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
805 "Normal hook, run each time a new outgoing message is initialized.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
806 The function `message-setup' runs this hook."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
807 :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
808 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
809 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
810
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
811 (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
812 "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
813 :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
814 :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
815 :type 'hook)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
816
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
817 (defcustom message-signature-setup-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
818 "Normal hook, run each time a new outgoing message is initialized.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
819 It is run after the headers have been inserted and before
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
820 the signature is inserted."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
821 :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
822 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
823 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
824
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
825 (defcustom message-mode-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
826 "Hook run in message mode buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
827 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
828 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
829
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
830 (defcustom message-header-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
831 "Hook run in a message mode buffer narrowed to the headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
832 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
833 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
834
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
835 (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
836 "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
837 :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
838 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
839 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
840
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
841 (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
842 (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
843 (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
844 map)
57856
df80d19d7a2e Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660
Miles Bader <miles@gnu.org>
parents: 57581
diff changeset
845 "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
846 :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
847 :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
848
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
849 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
850 (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
851 "*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
852
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
853 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
854 `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
855 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
856 configuration. See the variable `gnus-cite-attribution-suffix'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
857 :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
858 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
859 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
860
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
861 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
862 (defcustom message-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
863 "*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
864 Fix `message-cite-prefix-regexp' if it 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
865 See also `message-yank-cited-prefix'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
866 :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
867 :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
868 :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
869
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
870 (defcustom message-yank-cited-prefix ">"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
871 "*Prefix inserted on cited or empty 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
872 Fix `message-cite-prefix-regexp' if it 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
873 See also `message-yank-prefix'."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
874 :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
875 :type 'string
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
876 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
877 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
878
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
879 (defcustom message-indentation-spaces 3
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
880 "*Number of spaces to insert at the beginning of each cited line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
881 Used by `message-yank-original' via `message-yank-cite'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
882 :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
883 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
884 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
885
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
886 ;;;###autoload
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
887 (defcustom message-cite-function 'message-cite-original
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
888 "*Function for citing an original message.
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
889 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
890 `message-cite-original-without-signature'.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
891 Note that `message-cite-original' uses `mail-citation-hook' if that is non-nil."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
892 :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
893 (function-item message-cite-original-without-signature)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
894 (function-item sc-cite-original)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
895 (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
896 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
897 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
898
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
899 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
900 (defcustom message-indent-citation-function 'message-indent-citation
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
901 "*Function for modifying a citation just inserted in the mail buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
902 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
903 citation between (point) and (mark t). And each function should leave
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
904 point and mark around the citation text as modified."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
905 :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
906 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
907 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
908
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
909 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
910 (defcustom message-signature t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
911 "*String to be inserted at the end of the message buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
912 If t, the `message-signature-file' file will be inserted instead.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
913 If a function, the result from the function will be used instead.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
914 If a form, the result from the form will be used instead."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
915 :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
916 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
917 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
918
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
919 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
920 (defcustom message-signature-file "~/.signature"
36036
dcbe0206da25 (message-signature-file): Fix doc, :type.
Dave Love <fx@gnu.org>
parents: 35957
diff changeset
921 "*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
922 Ignored if the named file doesn't exist.
dcbe0206da25 (message-signature-file): Fix doc, :type.
Dave Love <fx@gnu.org>
parents: 35957
diff changeset
923 If nil, don't insert a signature."
dcbe0206da25 (message-signature-file): Fix doc, :type.
Dave Love <fx@gnu.org>
parents: 35957
diff changeset
924 :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
925 :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
926 :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
927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
928 ;;;###autoload
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
929 (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
930 "*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
931 :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
932 :type 'boolean
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
933 :link '(custom-manual "(message)Insertion Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
934 :group 'message-insertion)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
935
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
936 (defcustom message-distribution-function nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
937 "*Function called to return a Distribution header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
938 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
939 :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
940 :link '(custom-manual "(message)News Headers")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
941 :type '(choice function (const nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
942
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
943 (defcustom message-expires 14
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
944 "Number of days before your article expires."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
945 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
946 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
947 :link '(custom-manual "(message)News Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
948 :type 'integer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
949
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
950 (defcustom message-user-path nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
951 "If nil, use the NNTP server name in the Path header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
952 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
953 :group 'message-news
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
954 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
955 :link '(custom-manual "(message)News Headers")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
956 :type '(choice (const :tag "nntp" nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
957 (string :tag "name")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
958 (sexp :tag "none" :format "%t" t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
959
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
960 (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
961 (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
962 "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
963 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
964 \[number subject from date id references chars lines xref extra].")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
965 (defvar message-newsreader nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
966 (defvar message-mailer nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
967 (defvar message-sent-message-via nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
968 (defvar message-checksum nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
969 (defvar message-send-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
970 "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
971 (defvar message-exit-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
972 "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
973 (defvar message-kill-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
974 "A list of actions to be performed before killing a message buffer.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
975 (defvar message-postpone-actions nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
976 "A list of actions to be performed after postponing a message.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
977
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
978 (define-widget 'message-header-lines 'text
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
979 "All header lines must be LFD terminated."
33982
ff339ba39162 (message-header-lines): Fontify tag.
Miles Bader <miles@gnu.org>
parents: 33768
diff changeset
980 :format "%{%t%}:%n%v"
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
981 :valid-regexp "^\\'"
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
982 :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
983
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
984 (defcustom message-default-headers ""
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
985 "*A string containing header lines to be inserted in outgoing messages.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
986 It is inserted before you edit the message, so you can edit or delete
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
987 these lines."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
988 :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
989 :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
990 :type 'message-header-lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
991
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
992 (defcustom message-default-mail-headers ""
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
993 "*A string of header lines to be inserted in outgoing mails."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
994 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
995 :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
996 :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
997 :type 'message-header-lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
998
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
999 (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
1000 "*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
1001 :group 'message-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1002 :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
1003 :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
1004 :type 'message-header-lines)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1005
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1006 ;; Note: could use /usr/ucb/mail instead of sendmail;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1007 ;; options -t, and -v if not interactive.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1008 (defcustom message-mailer-swallows-blank-line
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1009 (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1010 system-configuration)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1011 (file-readable-p "/etc/sendmail.cf")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1012 (let ((buffer (get-buffer-create " *temp*")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1013 (unwind-protect
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1014 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1015 (set-buffer buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1016 (insert-file-contents "/etc/sendmail.cf")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1017 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1018 (let ((case-fold-search nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1019 (re-search-forward "^OR\\>" nil t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1020 (kill-buffer buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1021 ;; According to RFC822, "The field-name must be composed of printable
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1022 ;; ASCII characters (i. e., characters that have decimal values between
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1023 ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1024 ;; space, or colon.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1025 '(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
1026 "*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
1027 \(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
1028 The value should be an expression to test whether the problem will
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1029 actually occur."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1030 :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
1031 :link '(custom-manual "(message)Mail Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1032 :type 'sexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1033
19481
4d492290e085 (message-user-agent): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 17493
diff changeset
1034 ;;;###autoload
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1035 (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
1036 '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
1037 'message-kill-buffer 'message-send-hook)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1038
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1039 (defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1040 "If non-nil, delete the deletable headers before feeding to mh.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1041
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1042 (defvar message-send-method-alist
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1043 '((news message-news-p message-send-via-news)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1044 (mail message-mail-p message-send-via-mail))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1045 "Alist of ways to send outgoing messages.
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1046 Each element has the form
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1047
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1048 \(TYPE PREDICATE FUNCTION)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1049
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1050 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
1051 called without any parameters to determine whether the message is
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1052 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
1053 PREDICATE returns non-nil. FUNCTION is called with one parameter --
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1054 the prefix.")
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1055
34058
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1056 (defcustom message-mail-alias-type 'abbrev
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1057 "*What alias expansion type to use in Message buffers.
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1058 The default is `abbrev', which uses mailabbrev. nil switches
34058
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1059 mail aliases off."
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1060 :group 'message
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1061 :link '(custom-manual "(message)Mail Aliases")
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1062 :type '(choice (const :tag "Use Mailabbrev" abbrev)
9f5e2364ef2b (message-mail-alias-type): Customize.
Dave Love <fx@gnu.org>
parents: 34057
diff changeset
1063 (const :tag "No expansion" nil)))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
1064
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1065 (defcustom message-auto-save-directory
34057
98bd49d8cf7d (message-auto-save-directory): Use
Dave Love <fx@gnu.org>
parents: 33982
diff changeset
1066 (file-name-as-directory (nnheader-concat message-directory "drafts"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1067 "*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
1068 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
1069 :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
1070 :link '(custom-manual "(message)Various Message Variables")
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1071 :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
1072
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1073 (defcustom message-default-charset
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1074 (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
1075 "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
1076 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
1077 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1078 :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
1079 :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
1080 :type 'symbol)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1081
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1082 (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
1083 (and (boundp 'rmail-dont-reply-to-names) rmail-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
1084 "*A regexp specifying addresses to prune when doing wide replies.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1085 A value of nil means 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
1086 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1087 :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
1088 :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
1089 :type '(choice (const :tag "Yourself" nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1090 regexp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1091
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1092 (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
1093 "*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
1094 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
1095 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
1096 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
1097 candidates:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1098 `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
1099 `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
1100 `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
1101 `cancel-messages' Allow you to cancel or supersede messages from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1102 your other email addresses.")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1103
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1104 (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
1105 (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
1106 (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
1107
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1108 (defcustom message-hidden-headers nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1109 "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
1110 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
1111 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
1112 :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
1113 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1114 :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
1115 :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
1116
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1117 ;;; Internal variables.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1118 ;;; Well, not really internal.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1119
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1120 (defvar message-mode-syntax-table
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1121 (let ((table (copy-syntax-table text-mode-syntax-table)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1122 (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
1123 (modify-syntax-entry ?> ". " table)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1124 (modify-syntax-entry ?< ". " table)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1125 table)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1126 "Syntax table used while in Message mode.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1127
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1128 (defface message-header-to
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1129 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1130 (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
1131 (:foreground "green2" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1132 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1133 (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
1134 (:foreground "MidnightBlue" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1135 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1136 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1137 "Face used for displaying From headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1138 :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
1139 ;; 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
1140 (put 'message-header-to-face 'face-alias 'message-header-to)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1141
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1142 (defface message-header-cc
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1143 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1144 (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
1145 (:foreground "green4" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1146 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1147 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1148 (:foreground "MidnightBlue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1149 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1150 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1151 "Face used for displaying Cc headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1152 :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
1153 ;; 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
1154 (put 'message-header-cc-face 'face-alias 'message-header-cc)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1155
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1156 (defface message-header-subject
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1157 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1158 (background dark))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1159 (:foreground "green3"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1160 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1161 (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
1162 (:foreground "navy blue" :bold t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1163 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1164 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1165 "Face used for displaying subject headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1166 :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
1167 ;; 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
1168 (put 'message-header-subject-face 'face-alias 'message-header-subject)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1169
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1170 (defface message-header-newsgroups
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1171 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1172 (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
1173 (:foreground "yellow" :bold t :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1174 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1175 (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
1176 (:foreground "blue4" :bold t :italic t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1177 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1178 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1179 "Face used for displaying newsgroups headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1180 :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
1181 ;; 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
1182 (put 'message-header-newsgroups-face 'face-alias 'message-header-newsgroups)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1183
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1184 (defface message-header-other
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1185 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1186 (background dark))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1187 (:foreground "#b00000"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1188 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1189 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1190 (:foreground "steel blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1191 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1192 (:bold t :italic t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1193 "Face used for displaying newsgroups headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1194 :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
1195 ;; 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
1196 (put 'message-header-other-face 'face-alias 'message-header-other)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1197
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1198 (defface message-header-name
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1199 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1200 (background dark))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1201 (:foreground "DarkGreen"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1202 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1203 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1204 (:foreground "cornflower blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1205 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1206 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1207 "Face used for displaying header names."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1208 :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
1209 ;; 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
1210 (put 'message-header-name-face 'face-alias '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
1211
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1212 (defface message-header-xheader
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1213 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1214 (background dark))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1215 (:foreground "blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1216 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1217 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1218 (:foreground "blue"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1219 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1220 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1221 "Face used for displaying X-Header headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1222 :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
1223 ;; 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
1224 (put 'message-header-xheader-face 'face-alias 'message-header-xheader)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1225
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1226 (defface message-separator
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1227 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1228 (background dark))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1229 (:foreground "blue3"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1230 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1231 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1232 (:foreground "brown"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1233 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1234 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1235 "Face used for displaying the separator."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1236 :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
1237 ;; 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
1238 (put 'message-separator-face 'face-alias 'message-separator)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1239
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1240 (defface message-cited-text
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1241 '((((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1242 (background dark))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1243 (:foreground "red"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1244 (((class color)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1245 (background light))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1246 (:foreground "red"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1247 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1248 (:bold t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1249 "Face used for displaying cited text names."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1250 :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
1251 ;; 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
1252 (put 'message-cited-text-face 'face-alias 'message-cited-text)
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1253
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1254 (defface message-mml
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1255 '((((class color)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1256 (background dark))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1257 (:foreground "ForestGreen"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1258 (((class color)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1259 (background light))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1260 (:foreground "ForestGreen"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1261 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1262 (:bold t)))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1263 "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
1264 :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
1265 ;; 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
1266 (put 'message-mml-face 'face-alias 'message-mml)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1267
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1268 (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
1269 (let ((form
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1270 `(lambda (limit)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1271 (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
1272 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1273 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1274 (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
1275 (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
1276 (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
1277 nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1278 (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
1279 (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
1280 (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
1281 (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
1282 (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
1283 (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
1284 form)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1285
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1286 (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
1287 (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
1288 `((,(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
1289 (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
1290 (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
1291 (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
1292 (,(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
1293 (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
1294 (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
1295 (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
1296 (,(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
1297 (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
1298 (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
1299 (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
1300 (,(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
1301 (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
1302 (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
1303 (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
1304 (,(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
1305 (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
1306 (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
1307 (2 'message-header-other 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
1308 (,(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
1309 (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content))
63480
53e7abe8917f Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents: 63398
diff changeset
1310 (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
1311 (2 'message-header-name))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1312 ,@(if (and mail-header-separator
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1313 (not (equal mail-header-separator "")))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1314 `((,(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
1315 1 'message-separator))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1316 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1317 ((lambda (limit)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1318 (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
1319 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
1320 "\\).*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1321 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
1322 (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
1323 ("<#/?\\(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
1324 (0 'message-mml))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1325 "Additional expressions to highlight in Message mode.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1326
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1327
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1328 ;; 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
1329 ;; `font-lock-defaults' buffer-local variable.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1330 (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
1331
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1332 (defvar message-face-alist
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1333 '((bold . bold-region)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1334 (underline . underline-region)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1335 (default . (lambda (b e)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1336 (unbold-region b e)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1337 (ununderline-region b e))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1338 "Alist of mail and news faces for facemenu.
48588
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 48376
diff changeset
1339 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
1340
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1341 (defcustom message-send-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
1342 "Hook run before sending messages.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1343 This hook is run quite early when sending."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1344 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1345 :options '(ispell-message)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1346 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1347 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1348
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1349 (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
1350 "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
1351 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
1352 mail."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1353 :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
1354 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1355 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1356
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1357 (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
1358 "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
1359 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
1360 news."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1361 :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
1362 :link '(custom-manual "(message)Various Message Variables")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1363 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1364
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1365 (defcustom message-sent-hook nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1366 "Hook run after sending messages."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1367 :group 'message-various
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1368 :type 'hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1369
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1370 (defvar message-send-coding-system 'binary
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1371 "Coding system to encode outgoing mail.")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1372
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1373 (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
1374 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
1375 "*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
1376 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
1377 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
1378 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
1379
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1380 (defcustom message-send-mail-partially-limit 1000000
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1381 "The limitation of messages sent as message/partial.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1382 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
1383 should be sent in several parts. If it is nil, the size is unlimited."
33400
42c1ba3caf9c (message-forward-as-mime, message-forward-ignored-headers)
Dave Love <fx@gnu.org>
parents: 33375
diff changeset
1384 :version "21.1"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1385 :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
1386 :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
1387 :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
1388 (integer 1000000)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1389
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1390 (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
1391 "*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
1392 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
1393 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
1394 outgoing messages.
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1395
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
1396 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
1397 off `message-setup-hook'."
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1398 :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
1399 :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
1400 :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
1401 regexp))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1402
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1403 (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
1404 "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
1405
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1406 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
1407 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
1408 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
1409 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
1410 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
1411 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
1412 downcased."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
1413 :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
1414 :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
1415 :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
1416
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1417 (defcustom message-mail-user-agent nil
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1418 "Like `mail-user-agent'.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1419 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
1420 `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
1421 :version "22.1"
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1422 :type '(radio (const :tag "Gnus native"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1423 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1424 nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1425 (const :tag "`mail-user-agent'"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1426 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1427 t)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1428 (function-item :tag "Default Emacs mail"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1429 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1430 sendmail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1431 (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
1432 :format "%t\n"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1433 mh-e-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1434 (function :tag "Other"))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1435 :version "21.1"
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1436 :group 'message)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
1437
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1438 (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
1439 "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
1440 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
1441 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
1442 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
1443 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
1444 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
1445 :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
1446 :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
1447 :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
1448 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1449
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1450 (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
1451 "*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
1452 :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
1453 :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
1454 :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
1455 :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
1456 (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
1457
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1458 (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
1459 (file-error))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1460 (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
1461 (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
1462 (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
1463 "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
1464 t)
8e46fef0174c Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-566
Miles Bader <miles@gnu.org>
parents: 65719
diff changeset
1465 "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
1466 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
1467 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
1468 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
1469 :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
1470 :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
1471 :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
1472 :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
1473 (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
1474 (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
1475
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1476 ;;; Internal variables.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1477
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
1478 (defvar message-sending-message "Sending...")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1479 (defvar message-buffer-list nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1480 (defvar message-this-is-news nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1481 (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
1482 (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
1483 (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
1484 (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
1485 (defvar message-inserted-headers nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1486
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1487 ;; Byte-compiler warning
33301
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
1488 (eval-when-compile
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
1489 (defvar gnus-active-hashtb)
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
1490 (defvar gnus-read-active-file))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1491
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1492 ;;; 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
1493 ;;; (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
1494 ;;; of rmail.el's rmail-unix-mail-delimiter.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1495 (defvar message-unix-mail-delimiter
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1496 (let ((time-zone-regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1497 (concat "\\([A-Z]?[A-Z]?[A-Z][A-Z]\\( DST\\)?"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1498 "\\|[-+]?[0-9][0-9][0-9][0-9]"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1499 "\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1500 "\\) *")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1501 (concat
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1502 "From "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1503
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1504 ;; 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
1505 ;; 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
1506 ;; `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
1507 ;; `<@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
1508 ;; can be removed, e.g.
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1509 ;; From: joe@y.z (Joe K
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1510 ;; User)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1511 ;; 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
1512 ;; From: Joe User
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1513 ;; <joe@y.z>
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1514 ;; 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
1515 ;; 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
1516 ;; From: "Joe User"{space}{tab}
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1517 ;; <joe@y.z>
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1518 ;; 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
1519 ;; 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
1520 ;; 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
1521 ;; 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
1522 ;; 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
1523 "\\([^\0-\b\n-\r\^?].*\\)?"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1524
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1525 ;; 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
1526 "\\([^\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
1527 "\\([^\0-\r \^?]+\\) +" ; month
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1528 "\\([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
1529 "\\([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
1530
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1531 ;; Perhaps a time zone, specified by an abbreviation, or by a
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1532 ;; numeric offset.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1533 time-zone-regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1534
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1535 ;; The year.
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1536 " \\([0-9][0-9]+\\) *"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1537
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1538 ;; On some systems the time zone can appear after the year, too.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1539 time-zone-regexp
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1540
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1541 ;; Old uucp cruft.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1542 "\\(remote from .*\\)?"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1543
19762
f6ca32374b0b (message-unix-mail-delimiter): Initialize
Richard M. Stallman <rms@gnu.org>
parents: 19525
diff changeset
1544 "\n"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1545 "Regexp matching the delimiter of messages in UNIX mail format.")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1546
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1547 (defvar message-unsent-separator
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1548 (concat "^ *---+ +Unsent message follows +---+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1549 "^ *---+ +Returned message +---+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1550 "^Start of returned message$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1551 "^ *---+ +Original message +---+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1552 "^ *--+ +begin message +--+ *$\\|"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1553 "^ *---+ +Original message follows +---+ *$\\|"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1554 "^ *---+ +Undelivered message follows +---+ *$\\|"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1555 "^|? *---+ +Message text follows: +---+ *|?$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1556 "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
1557
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1558 (defvar message-header-format-alist
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1559 `((Newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1560 (To . message-fill-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1561 (Cc . message-fill-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1562 (Subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1563 (In-Reply-To)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1564 (Fcc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1565 (Bcc)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1566 (Date)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1567 (Organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1568 (Distribution)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1569 (Lines)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1570 (Expires)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1571 (Message-ID)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1572 (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
1573 (User-Agent))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1574 "Alist used for formatting headers.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1575
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1576 (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
1577 "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
1578
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1579 (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
1580 "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
1581
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1582 (defvar message-bogus-system-names "^localhost\\."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1583 "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
1584
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1585 (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
1586 (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
1587 ;; valid TLDs:
70245
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1588 "\\([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
1589 "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
1590 "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
1591 "info\\|int\\|jobs\\|"
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1592 "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
1593 "org\\|pro\\|travel\\|uucp\\)")
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
1594 ;; 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
1595 ;; 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
1596 ;; `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
1597 ;; "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
1598 "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
1599 ;; 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
1600 :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
1601 :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
1602 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1603
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1604 (eval-and-compile
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1605 (autoload 'idna-to-ascii "idna")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1606 (autoload 'message-setup-toolbar "messagexmas")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1607 (autoload 'mh-new-draft-name "mh-comp")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1608 (autoload 'mh-send-letter "mh-comp")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1609 (autoload 'gnus-point-at-eol "gnus-util")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1610 (autoload 'gnus-point-at-bol "gnus-util")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1611 (autoload 'gnus-output-to-rmail "gnus-util")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1612 (autoload 'gnus-output-to-mail "gnus-util")
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1613 (autoload 'nndraft-request-associate-buffer "nndraft")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1614 (autoload 'nndraft-request-expire-articles "nndraft")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1615 (autoload 'gnus-open-server "gnus-int")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1616 (autoload 'gnus-request-post "gnus-int")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1617 (autoload 'gnus-alive-p "gnus-util")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1618 (autoload 'gnus-server-string "gnus")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1619 (autoload 'gnus-group-name-charset "gnus-group")
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1620 (autoload 'gnus-group-name-decode "gnus-group")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1621 (autoload 'gnus-groups-from-server "gnus")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1622 (autoload 'rmail-output "rmailout")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1623 (autoload 'gnus-delay-article "gnus-delay")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1624 (autoload 'gnus-make-local-hook "gnus-util")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1625 (autoload 'gnus-extract-address-components "gnus-util"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1626
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1627
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1628
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1629 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1630 ;;; Utility functions.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1631 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1632
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1633 (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
1634 "Ask QUESTION, displaying remaining args in a temporary buffer if SHOW."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1635 `(message-talkative-question 'y-or-n-p ,question ,show ,@text))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1636
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1637 (defmacro message-delete-line (&optional n)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1638 "Delete the current line (and the next N lines)."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1639 `(delete-region (progn (beginning-of-line) (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1640 (progn (forward-line ,(or n 1)) (point))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1641
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1642 (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
1643 "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
1644 mark-active)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1645
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1646 (defun message-unquote-tokens (elems)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1647 "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
1648 (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
1649 (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
1650 (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
1651 (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
1652 item)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1653 elems))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1654
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1655 (defun message-tokenize-header (header &optional separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1656 "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
1657 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
1658 is used by default."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1659 (if (not header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1660 nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1661 (let ((regexp (format "[%s]+" (or separator ",")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1662 (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
1663 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
1664 (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
1665 (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
1666 (setq beg (point-min))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1667 (insert header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1668 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1669 (while (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1670 (if first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1671 (setq first nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1672 (forward-char 1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1673 (cond ((and (> (point) beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1674 (or (eobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1675 (and (looking-at regexp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1676 (not quoted)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1677 (not paren))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1678 (push (buffer-substring beg (point)) elems)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1679 (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
1680 ((eq (char-after) ?\")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1681 (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
1682 ((and (eq (char-after) ?\()
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1683 (not quoted))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1684 (setq paren t))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1685 ((and (eq (char-after) ?\))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1686 (not quoted))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1687 (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
1688 (nreverse elems)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1689
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1690 (defun message-mail-file-mbox-p (file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1691 "Say whether FILE looks like a Unix mbox file."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1692 (when (and (file-exists-p file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1693 (file-readable-p file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1694 (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
1695 (with-temp-buffer
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1696 (nnheader-insert-file-contents file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1697 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1698 (looking-at message-unix-mail-delimiter))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1699
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1700 (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
1701 "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
1702 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
1703 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
1704 (let* ((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
1705 (case-fold-search t)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
1706 (value (mail-fetch-field header nil (not not-all))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1707 (when value
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1708 (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
1709 (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
1710 (set-text-properties 0 (length value) nil value)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1711 value)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1712
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1713 (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
1714 "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
1715 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1716 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1717 (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
1718 (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
1719
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1720 (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
1721 "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
1722 (beginning-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1723 (narrow-to-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1724 (point)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1725 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1726 (forward-line 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1727 (if (re-search-forward "^[^ \n\t]" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1728 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1729 (beginning-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1730 (point))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1731 (point-max))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1732 (goto-char (point-min)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1733
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1734 (defun message-add-header (&rest headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1735 "Add the HEADERS to the message header, skipping those already present."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1736 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1737 (let (hclean)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1738 (unless (string-match "^\\([^:]+\\):[ \t]*[^ \t]" (car headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1739 (error "Invalid header `%s'" (car headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1740 (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
1741 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1742 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1743 (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
1744 (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
1745 (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
1746 (insert (car headers))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
1747 (insert (car headers) ?\n)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1748 (setq headers (cdr headers))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1749
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1750 (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
1751 "Evaluate FORMS in the reply buffer, if it exists."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1752 `(when (and 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
1753 (buffer-name 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
1754 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1755 (set-buffer 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
1756 ,@forms)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1757
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1758 (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
1759 (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
1760
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1761 (defun message-fetch-reply-field (header)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1762 "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
1763 (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
1764 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1765 (mail-narrow-to-head)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1766 (message-fetch-field header))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1767
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1768 (defun message-strip-list-identifiers (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1769 "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
1770 (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
1771 (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
1772 gnus-list-identifiers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1773 (mapconcat 'identity gnus-list-identifiers " *\\|"))))
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1774 (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
1775 " *\\)\\)+\\(Re: +\\)?\\)") subject)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1776 (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
1777 (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
1778 (match-string 5 subject))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1779 (substring subject
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1780 (match-end 1)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1781 subject)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
1782
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1783 (defun message-strip-subject-re (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
1784 "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
1785 (if (string-match message-subject-re-regexp subject)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1786 (substring subject (match-end 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1787 subject))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1788
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1789 ;;; 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
1790
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1791 (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
1792 "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
1793 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
1794 `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
1795 (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
1796 (new) (found))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1797 (setq found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1798 (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1799 (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
1800 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
1801 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
1802 subject))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1803 (if found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1804 (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
1805 (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
1806 subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1807 (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
1808 (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
1809 "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
1810 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1811 "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
1812 "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
1813 "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
1814 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
1815 "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
1816 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
1817 "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
1818 "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
1819 ))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1820 new subject)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1821 new))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1822
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1823 ;;; 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
1824
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1825 (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
1826 "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
1827 ;; <URL:http://www.landfield.com/usefor/drafts/draft-ietf-usefor-useage--1.02.unpaged>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1828 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1829 (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1830 (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
1831 (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
1832 (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
1833 (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
1834 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1835 (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
1836 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1837 (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
1838 (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
1839 (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
1840 (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
1841 ((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
1842 (concat "^[ \t]*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1843 (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
1844 " \t]*$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1845 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
1846 ;; 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
1847 (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
1848 (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
1849 (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
1850 (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
1851 (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
1852 new-subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1853 " (was: "
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
1854 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
1855
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1856 (defun message-mark-inserted-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
1857 "Mark some region in the current article 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
1858 See `message-mark-insert-begin' and `message-mark-insert-end'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1859 (interactive "r")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1860 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1861 ;; 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
1862 (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
1863 (insert message-mark-insert-end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1864 (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
1865 (insert message-mark-insert-begin)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1866
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1867 (defun message-mark-insert-file (file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1868 "Insert FILE at point, marking it 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
1869 See `message-mark-insert-begin' and `message-mark-insert-end'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1870 (interactive "fFile to insert: ")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1871 ;; 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
1872 (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
1873 (insert message-mark-insert-end)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1874 (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
1875 (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
1876 (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
1877 (insert message-mark-insert-begin)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1878
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1879 (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
1880 "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
1881 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
1882 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
1883 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
1884 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1885 (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
1886 (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
1887 (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
1888 (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
1889 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1890 (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
1891 (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
1892 (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
1893 (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
1894 (newline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1895 (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
1896 (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
1897
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1898 (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
1899 "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
1900 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
1901 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1902 (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
1903 (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
1904 (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
1905 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
1906 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
1907 (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
1908 '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
1909 (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
1910 (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
1911 (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
1912 ;; 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
1913 (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
1914 (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
1915 (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
1916 nil t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1917 (replace-match ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1918 ;; 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
1919 ;; 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
1920 ;; 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
1921 (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
1922 ;; 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
1923 (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
1924 ;; 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
1925 (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
1926 (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
1927 (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
1928 (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
1929 (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
1930 (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
1931 (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
1932 ;; 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
1933 ;; 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
1934 (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
1935 target-group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1936 "[ \t]*$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1937 (message-fetch-field "Newsgroups")))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
1938 (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
1939 (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
1940
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1941 (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
1942 old-groups)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1943 "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
1944 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
1945 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
1946 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
1947 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
1948 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
1949 ;; 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
1950 (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
1951 (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
1952 (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
1953 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
1954 (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
1955 (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
1956 (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
1957 head t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1958 (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
1959 (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
1960 (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
1961 (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
1962 head t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1963 (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
1964 ;; 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
1965 (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
1966 (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
1967 (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
1968 (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
1969 (string-match "^[ \t]*poster[ \t]*$" target-group))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
1970 (insert (concat message-followup-to-note target-group "\n"))
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
1971 (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
1972
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1973 (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
1974 "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
1975 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
1976 (interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1977 (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
1978 (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
1979 (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
1980 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
1981 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
1982 (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
1983 '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
1984 (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
1985 (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
1986 (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
1987 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1988 (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
1989 (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
1990 (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
1991 (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
1992 ;; 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
1993 (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
1994 (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
1995 ((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
1996 (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
1997 (concat "^[ \t]*"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
1998 (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
1999 "[ \t]*$")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2000 old-groups)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2001 ;; 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
2002 (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
2003 ;; 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
2004 (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
2005 target-group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2006 (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
2007 (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
2008 (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
2009 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
2010 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
2011
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2012 ;;; 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
2013
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2014 (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
2015 "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
2016 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2017 (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
2018 (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
2019 (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
2020 (bcc nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2021 (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
2022 (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
2023 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2024 (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
2025 (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
2026 (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
2027 (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
2028 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2029 (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
2030 (message-delete-line)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2031 (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
2032 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2033 (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
2034 (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
2035 "bcc"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2036 "cc"))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2037
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2038 ;;; 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
2039
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2040 (defun message-remove-header (header &optional is-regexp first reverse)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2041 "Remove HEADER in the narrowed buffer.
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2042 If IS-REGEXP, HEADER is a regular expression.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2043 If FIRST, only remove the first instance of the header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2044 Return the number of headers removed."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2045 (goto-char (point-min))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2046 (let ((regexp (if is-regexp header (concat "^" (regexp-quote header) ":")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2047 (number 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2048 (case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2049 last)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2050 (while (and (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2051 (not last))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2052 (if (if reverse
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2053 (not (looking-at regexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2054 (looking-at regexp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2055 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2056 (incf number)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2057 (when first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2058 (setq last t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2059 (delete-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2060 (point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2061 ;; There might be a continuation header, so we have to search
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2062 ;; until we find a new non-continuation line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2063 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2064 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2065 (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2066 (goto-char (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2067 (point-max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2068 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2069 (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2070 (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
2071 (goto-char (point-max)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2072 number))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2073
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2074 (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
2075 "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
2076 (let ((count 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2077 (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
2078 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2079 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2080 (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
2081 (incf count)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2082 (while (> count 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2083 (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
2084 (decf count))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2085
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2086 (defun message-narrow-to-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2087 "Narrow the buffer to the head of the message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2088 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2089 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2090 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2091 (if (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2092 (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2093 (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2094 (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2095 (goto-char (point-min)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2096
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2097 (defun message-narrow-to-head-1 ()
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2098 "Like `message-narrow-to-head'. Don't widen."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2099 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2100 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2101 (if (search-forward "\n\n" nil 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2102 (1- (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2103 (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2104 (goto-char (point-min)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2105
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2106 (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
2107 "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
2108 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
2109 (widen)
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
2110 (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
2111
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2112 (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
2113 "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
2114 (widen)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2115 (narrow-to-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2116 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2117 (cond
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2118 ((re-search-forward
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2119 (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2120 (match-beginning 0))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2121 ((search-forward "\n\n" nil t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2122 (1- (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2123 (t
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2124 (point-max))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2125 (goto-char (point-min)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2126
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2127 (defun message-news-p ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2128 "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
2129 (and (not message-this-is-mail)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2130 (or message-this-is-news
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2131 (save-excursion
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2132 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2133 (message-narrow-to-headers)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2134 (and (message-fetch-field "newsgroups")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2135 (not (message-fetch-field "posted-to"))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2136
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2137 (defun message-mail-p ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2138 "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
2139 (and (not message-this-is-news)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2140 (or message-this-is-mail
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2141 (save-excursion
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2142 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2143 (message-narrow-to-headers)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2144 (or (message-fetch-field "to")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2145 (message-fetch-field "cc")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2146 (message-fetch-field "bcc")))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2147
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2148 (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
2149 "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
2150 (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
2151 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
2152 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
2153 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
2154
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2155 (defun message-next-header ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2156 "Go to the beginning of the next header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2157 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2158 (or (eobp) (forward-char 1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2159 (not (if (re-search-forward "^[^ \t]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2160 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2161 (goto-char (point-max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2162
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2163 (defun message-sort-headers-1 ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2164 "Sort the buffer as headers using `message-rank' text props."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2165 (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
2166 (require 'sort)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2167 (sort-subr
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2168 nil 'message-next-header
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2169 (lambda ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2170 (message-next-header)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2171 (unless (bobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2172 (forward-char -1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2173 (lambda ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2174 (or (get-text-property (point) 'message-rank)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2175 10000))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2176
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2177 (defun message-sort-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2178 "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
2179 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2180 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2181 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2182 (let ((max (1+ (length message-header-format-alist)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2183 rank)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2184 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2185 (while (re-search-forward "^[^ \n]+:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2186 (put-text-property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2187 (match-beginning 0) (1+ (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2188 'message-rank
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2189 (if (setq rank (length (memq (assq (intern (buffer-substring
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2190 (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2191 (1- (match-end 0))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2192 message-header-format-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2193 message-header-format-alist)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2194 (- max rank)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2195 (1+ max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2196 (message-sort-headers-1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2197
68230
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2198 (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
2199 "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
2200
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2201 Prefixed with one \\[universal-argument], display the Emacs MIME manual.
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2202 Prefixed with two \\[universal-argument]'s, display the PGG manual."
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2203 (interactive "p")
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2204 (cond ((eq arg 16) (Info-goto-node "(pgg)Top"))
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2205 ((eq arg 4) (Info-goto-node "(emacs-mime)Top"))
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2206 (t (Info-goto-node "(message)Top"))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2207
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2208
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2209
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2210 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2211 ;;; Message mode
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2212 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2213
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2214 ;;; Set up keymap.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2215
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2216 (defvar message-mode-map nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2217
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2218 (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
2219 (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
2220 (set-keymap-parent message-mode-map text-mode-map)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2221 (define-key message-mode-map "\C-c?" 'describe-mode)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2222
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2223 (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
2224 (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
2225 (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
2226 (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
2227 (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
2228 (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
2229 (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
2230 (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
2231 (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
2232 (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
2233 (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
2234 (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
2235 (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
2236 (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
2237 '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
2238 (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
2239 '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
2240
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2241 ;; 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
2242 (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
2243 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2244 (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
2245 ;; 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
2246 (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
2247 (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
2248 ;; 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
2249 (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
2250 (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
2251
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2252 (define-key message-mode-map "\C-c\C-b" 'message-goto-body)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2253 (define-key message-mode-map "\C-c\C-i" 'message-goto-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2254
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2255 (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
2256 (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
2257 (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
2258 (define-key message-mode-map "\C-c\C-l" '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
2259
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2260 (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
2261 (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
2262 'message-insert-disposition-notification-to)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2263
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2264 (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
2265 (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
2266 (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
2267 (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
2268 (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
2269 (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
2270 (define-key message-mode-map "\C-c\C-o" 'message-sort-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2271 (define-key message-mode-map "\C-c\M-r" 'message-rename-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2272
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2273 (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
2274 (define-key message-mode-map "\C-c\C-s" 'message-send)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2275 (define-key message-mode-map "\C-c\C-k" 'message-kill-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2276 (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
2277 (define-key message-mode-map "\C-c\n" 'gnus-delay-article)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2278
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2279 (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
2280 (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
2281 (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
2282 (define-key message-mode-map "\M-\r" 'message-newline-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
2283 ;;(define-key message-mode-map "\M-q" 'message-fill-paragraph)
49034
b6e082e00b00 (message-split-line): New function.
Kim F. Storm <storm@cua.dk>
parents: 48588
diff changeset
2284 (define-key message-mode-map [remap split-line] 'message-split-line)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2285
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2286 (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
2287
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2288 (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
2289 (define-key message-mode-map "\t" 'message-tab)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2290 (define-key message-mode-map "\M-;" 'comment-region))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2291
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2292 (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
2293 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
2294 `("Message"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2295 ["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
2296 ["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
2297 ["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
2298 ["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
2299 ["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
2300 ["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
2301 :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
2302 ,@(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
2303 '(: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
2304 ["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
2305 :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
2306 ,@(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
2307 '(: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
2308 ["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
2309 ["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
2310 ["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
2311 ["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
2312 ,@(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
2313 '(: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
2314 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2315 ["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
2316 :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
2317 ,@(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
2318 '(: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
2319 ["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
2320 ,@(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
2321 '(: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
2322 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2323 ["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
2324 ,@(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
2325 '(: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
2326 ["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
2327 ,@(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
2328 '(: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
2329 ["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
2330 ,@(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
2331 '(: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
2332 ["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
2333 ,@(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
2334 '(: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
2335 "----"
6c7c654eb3c7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-702
Miles Bader <miles@gnu.org>
parents: 67032
diff changeset
2336 ["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
2337 ,@(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
2338 '(:help "Display the Message manual"))]))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2339
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2340 (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
2341 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
2342 `("Field"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2343 ["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
2344 ["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
2345 ["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
2346 ["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
2347 ["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
2348 ["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
2349 ["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
2350 ["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
2351 ["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
2352 ,@(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
2353 '(: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
2354 ["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
2355 ,@(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
2356 '(: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
2357 ["Request Receipt"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2358 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
2359 ,@(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
2360 '(: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
2361 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2362 ;; (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
2363 ["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
2364 ["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
2365 ["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
2366 ["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
2367 ["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
2368 ;; ["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
2369 ["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
2370 ["Distribution" message-goto-distribution t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2371 ["X-No-Archive:" message-add-archive-header t ]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2372 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2373 ;; (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
2374 ["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
2375 ,@(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
2376 '(: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
2377 ["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
2378 ,@(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
2379 '(:help
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2380 "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
2381 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2382 ["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
2383 ["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
2384 ["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
2385 ,@(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
2386 '(: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
2387 ["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
2388 "----"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2389 ["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
2390 ["Encode non-ASCII domain names" message-idna-to-ascii-rhs t]
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2391 ["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
2392 ["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
2393
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2394 (defvar message-tool-bar-map nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2395
33301
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
2396 (eval-when-compile
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
2397 (defvar facemenu-add-face-function)
c1c373a70748 Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents: 33199
diff changeset
2398 (defvar facemenu-remove-face-function))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2399
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2400 ;;; Forbidden properties
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2401 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2402 ;; We use `after-change-functions' to keep 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
2403 ;; that interfer with the normal function of message mode out of the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2404 ;; buffer.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2405
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2406 (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
2407 "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
2408
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2409 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
2410 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
2411 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
2412 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
2413 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
2414 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
2415 :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
2416 :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
2417 :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
2418 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2419
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2420 (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
2421 ;; 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
2422 ;; 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
2423 ;; 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
2424 '(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
2425 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
2426 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
2427 ;; 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
2428 ;; 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
2429 ;; 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
2430 ;; 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
2431 ;; 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
2432 "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
2433 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
2434
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2435 (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
2436 "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
2437 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
2438 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
2439 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
2440 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
2441 (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
2442 (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
2443 (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
2444 '(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
2445 (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
2446 (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
2447 (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
2448
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2449 (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
2450 "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
2451 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
2452 See also `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
2453 (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
2454 (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
2455 (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
2456 (inhibit-read-only t))
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2457 (while (not (= begin end))
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2458 (when (not (get-text-property begin 'message-hidden))
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2459 (remove-text-properties begin (1+ begin)
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2460 message-forbidden-properties))
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
2461 (incf begin)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2462
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2463 ;;;###autoload
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2464 (define-derived-mode message-mode text-mode "Message"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2465 "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
2466 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
2467 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
2468 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
2469 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
2470 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
2471 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
2472 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
2473 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
2474 C-c C-f C-k move to Keywords C-c C-f C-d move to Distribution
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2475 C-c C-f C-o move to From (\"Originator\")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2476 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
2477 C-c C-f C-m move to 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
2478 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
2479 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
2480 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
2481 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
2482 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
2483 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
2484 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
2485 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
2486 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
2487 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
2488 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
2489 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
2490 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
2491 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
2492 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
2493 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
2494 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
2495 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
2496 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
2497 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
2498 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
2499 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
2500 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
2501 (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
2502 (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
2503 (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
2504 (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
2505 (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
2506 (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
2507 (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
2508 (set (make-local-variable 'message-draft-article) nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2509 (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
2510 (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
2511 (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
2512 (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
2513 (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
2514 (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
2515 (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
2516 ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2517 (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
2518 (set (make-local-variable 'message-reply-headers) nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2519 (make-local-variable 'message-newsreader)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2520 (make-local-variable 'message-mailer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2521 (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
2522 (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
2523 (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
2524 (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
2525 (message-setup-fill-variables)
34766
053098519a45 Add comment.
Miles Bader <miles@gnu.org>
parents: 34762
diff changeset
2526 ;; 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
2527 ;; (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
2528 (when message-yank-prefix
5284e720208b (message-mode): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54277
diff changeset
2529 (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
2530 (set (make-local-variable 'comment-start-skip)
5284e720208b (message-mode): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 54277
diff changeset
2531 (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
2532 (if (featurep 'xemacs)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2533 (message-setup-toolbar)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2534 (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
2535 '(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
2536 (if (boundp 'tool-bar-map)
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
2537 (set (make-local-variable 'tool-bar-map) (message-make-tool-bar))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2538 (easy-menu-add message-mode-menu message-mode-map)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2539 (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
2540 (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
2541 ;; 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
2542 (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
2543 nil 'local)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2544 ;; Allow mail alias things.
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2545 (when (eq message-mail-alias-type 'abbrev)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2546 (if (fboundp 'mail-abbrevs-setup)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2547 (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
2548 (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
2549 (mail-aliases-setup))))
44075
7782e54757bb * mail-source.el (make-source-make-complex-temp-name): Use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 43075
diff changeset
2550 (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
2551 (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
2552 (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
2553 ;; 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
2554 ;; 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
2555 (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
2556 (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
2557 (mml-mode))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2558
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2559 (defun message-setup-fill-variables ()
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2560 "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
2561 (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
2562 'message-fill-paragraph)
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2563 (make-local-variable 'paragraph-separate)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2564 (make-local-variable 'paragraph-start)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2565 (make-local-variable 'adaptive-fill-regexp)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2566 (unless (boundp 'adaptive-fill-first-line-regexp)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2567 (setq adaptive-fill-first-line-regexp nil))
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2568 (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
2569 (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
2570 ;; 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
2571 ;; 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
2572 (concat "\\(" message-cite-prefix-regexp "\\)[ \t]*")))
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2573 (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
2574 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2575 (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
2576 "[ \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
2577 "-- $\\|" ; signature delimiter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2578 "---+$\\|" ; 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
2579 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
2580 ".*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
2581 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
2582 ; mml tags
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2583 "<#!*/?\\(multipart\\|part\\|external\\|mml\\|secure\\)"))
33436
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2584 (setq paragraph-separate paragraph-start)
a324254af725 From Emerick Rogul <emerick@csa.bu.edu>.
Dave Love <fx@gnu.org>
parents: 33400
diff changeset
2585 (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
2586 (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
2587 (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
2588 (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
2589 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
2590 (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
2591 ;;(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
2592 (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
2593 (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
2594 (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
2595 ;; 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
2596 ;; 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
2597 ;; 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
2598 ;; `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
2599 ;; -- Per Abrahamsen <abraham@dina.kvl.dk> Date: 2001-10-19.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2600 (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
2601 (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
2602
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2603
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2604
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2605 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2606 ;;; Message mode commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2607 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2608
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2609 ;;; Movement commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2610
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2611 (defun message-goto-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2612 "Move point to the To header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2613 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2614 (message-position-on-field "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2615
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2616 (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
2617 "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
2618 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2619 (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
2620
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2621 (defun message-goto-subject ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2622 "Move point to the Subject header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2623 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2624 (message-position-on-field "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2625
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2626 (defun message-goto-cc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2627 "Move point to the Cc header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2628 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2629 (message-position-on-field "Cc" "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2630
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2631 (defun message-goto-bcc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2632 "Move point to the Bcc header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2633 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2634 (message-position-on-field "Bcc" "Cc" "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2635
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2636 (defun message-goto-fcc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2637 "Move point to the Fcc header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2638 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2639 (message-position-on-field "Fcc" "To" "Newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2640
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2641 (defun message-goto-reply-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2642 "Move point to the Reply-To header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2643 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2644 (message-position-on-field "Reply-To" "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2645
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2646 (defun message-goto-newsgroups ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2647 "Move point to the Newsgroups header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2648 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2649 (message-position-on-field "Newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2650
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2651 (defun message-goto-distribution ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2652 "Move point to the Distribution header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2653 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2654 (message-position-on-field "Distribution"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2655
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2656 (defun message-goto-followup-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2657 "Move point to the Followup-To header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2658 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2659 (message-position-on-field "Followup-To" "Newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2660
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2661 (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
2662 "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
2663 (interactive)
57581
645f020dcc8a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents: 57561
diff changeset
2664 (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
2665
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2666 (defun message-goto-keywords ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2667 "Move point to the Keywords header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2668 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2669 (message-position-on-field "Keywords" "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2670
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2671 (defun message-goto-summary ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2672 "Move point to the Summary header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2673 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2674 (message-position-on-field "Summary" "Subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2675
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2676 (defun message-goto-body (&optional interactivep)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2677 "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
2678 (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
2679 (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
2680 (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
2681 (expand-abbrev))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2682 (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
2683 (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
2684 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2685
70245
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
2686 (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
2687 "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
2688 (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
2689 (>= (point) body)))
322c5c5027dc Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Miles Bader <miles@gnu.org>
parents: 70051
diff changeset
2690
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2691 (defun message-goto-eoh ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2692 "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
2693 (interactive)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2694 (message-goto-body)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2695 (forward-line -1))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2696
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2697 (defun message-goto-signature ()
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2698 "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
2699 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
2700 return nil."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2701 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2702 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2703 (if (re-search-forward message-signature-separator nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2704 (forward-line 1)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2705 (goto-char (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2706 nil))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2707
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2708 (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
2709 "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
2710 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
2711 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
2712 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
2713 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
2714 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
2715
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2716 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
2717 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
2718
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2719 (interactive "P")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2720 (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
2721 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2722 (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
2723 (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
2724 (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
2725 (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
2726 (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
2727 (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
2728 (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
2729 (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
2730
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2731
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2732
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2733 (defun message-insert-to (&optional force)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2734 "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
2735 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
2736 prefix FORCE is given."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
2737 (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
2738 (let* ((mct (message-fetch-reply-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
2739 (dont (and mct (or (equal (downcase mct) "never")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2740 (equal (downcase mct) "nobody"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2741 (to (or (message-fetch-reply-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
2742 (message-fetch-reply-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
2743 (message-fetch-reply-field "from"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2744 (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
2745 (message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2746 (if force
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2747 "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
2748 "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
2749 (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
2750 (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
2751 (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
2752 (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
2753
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2754 (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
2755 "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
2756 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2757 (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
2758 (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
2759 (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
2760
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2761 (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
2762 '((To Cc Bcc)
a87e26272828 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-210
Miles Bader <miles@gnu.org>
parents: 69572
diff changeset
2763 (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
2764 "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
2765 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
2766 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
2767 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
2768 :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
2769 :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
2770 :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
2771 :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
2772
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2773 (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
2774 "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
2775 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
2776 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
2777 ;; 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
2778 ;; 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
2779 ;; `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
2780 ;; (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
2781 (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
2782 (let* ((header-name (symbol-name (car header)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2783 (new-header (cdr header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2784 (synonyms (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
2785 when (memq (car header) synonym) return synonym))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2786 (old-header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2787 (loop for synonym in synonyms
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2788 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
2789 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
2790 return synonym)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2791 (if old-header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2792 (message "already have `%s' in `%s'" 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
2793 (when (and (message-position-on-field header-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2794 (setq old-header (mail-fetch-field header-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2795 (not (string-match "\\` *\\'" old-header)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2796 (insert ", "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2797 (insert new-header)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2798
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2799 (defun message-widen-reply ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2800 "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
2801 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2802 (let ((follow-to
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2803 (and message-reply-buffer
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2804 (buffer-name message-reply-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2805 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2806 (set-buffer message-reply-buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2807 (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
2808 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2809 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2810 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2811 (dolist (elem follow-to)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2812 (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
2813 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2814 (insert (symbol-name (car elem)) ": "
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2815 (cdr elem) "\n"))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2816
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2817 (defun message-insert-newsgroups ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2818 "Insert the Newsgroups header from the article being replied to."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2819 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2820 (when (and (message-position-on-field "Newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2821 (mail-fetch-field "newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2822 (not (string-match "\\` *\\'" (mail-fetch-field "newsgroups"))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2823 (insert ","))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2824 (insert (or (message-fetch-reply-field "newsgroups") "")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2825
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2826
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2827
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2828 ;;; Various commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2829
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2830 (defun message-delete-not-region (beg end)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2831 "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
2832 (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
2833 (let (citeprefix)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2834 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2835 (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
2836 ;; 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
2837 (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
2838 (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
2839 (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
2840 (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
2841 (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
2842 (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2843 (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
2844 (point)))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2845 (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
2846 (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
2847 (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
2848 (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
2849 (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2850 (when citeprefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2851 (insert citeprefix))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2852 (when (message-goto-signature)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2853 (forward-line -2)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2854
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2855 (defun message-kill-to-signature ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2856 "Deletes all text up to the signature."
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2857 (interactive)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2858 (let ((point (point)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2859 (message-goto-signature)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2860 (unless (eobp)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2861 (end-of-line -1))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2862 (kill-region point (point))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2863 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
2864 (insert "\n"))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2865
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2866 (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
2867 "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
2868 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
2869 (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
2870 (let (quoted point beg end leading-space bolp)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
2871 (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
2872 (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
2873 (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
2874 (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
2875 ;; 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
2876 (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
2877 (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
2878 (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
2879 (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
2880 (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
2881 ;; 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
2882 (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
2883 (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
2884 (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
2885 (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
2886 (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
2887 (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
2888 (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
2889 (not bolp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2890 (< (- 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
2891 ;; 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
2892 (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
2893 end nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2894 (if quoted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2895 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2896 (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
2897 (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
2898 (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
2899 (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
2900 (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
2901 (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
2902 (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
2903 (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
2904 (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
2905 (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
2906 (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
2907 (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
2908 (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
2909 (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
2910 (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
2911 (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
2912 (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
2913 (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
2914 (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
2915 (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
2916 (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
2917 (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
2918 (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
2919 (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
2920 (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
2921 (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
2922 (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
2923 (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
2924 (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
2925 (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
2926 (setq beg (point))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
2927 (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
2928 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2929 (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
2930 (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
2931 (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
2932 (if bolp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2933 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2934 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2935 (newline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2936 (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
2937 ;; (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
2938 ;; 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
2939 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2940 (newline)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2941 (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
2942 (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
2943 (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
2944 (undo-boundary)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2945 (if quoted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2946 (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
2947 (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
2948 (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
2949 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
2950 (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
2951 (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
2952 (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
2953
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2954 (defun message-fill-paragraph (&optional arg)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2955 "Like `fill-paragraph'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2956 (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
2957 (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
2958 nil
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2959 (message-newline-and-reformat arg t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2960 t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2961
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2962 ;; Is it better to use `mail-header-end'?
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2963 (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
2964 "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
2965 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2966 (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
2967 (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
2968 (not (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
2969 (concat "^" (regexp-quote mail-header-separator) "\n")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2970 p t)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2971
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2972 (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
2973 "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
2974 (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
2975 (do-auto-fill)))
49034
b6e082e00b00 (message-split-line): New function.
Kim F. Storm <storm@cua.dk>
parents: 48588
diff changeset
2976
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2977 (defun message-insert-signature (&optional force)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
2978 "Insert a signature. See documentation for variable `message-signature'."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2979 (interactive (list 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2980 (let* ((signature
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2981 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2982 ((and (null message-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2983 (eq force 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2984 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2985 (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
2986 (not (re-search-backward message-signature-separator nil t))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2987 ((and (null message-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2988 force)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2989 t)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
2990 ((functionp message-signature)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2991 (funcall message-signature))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2992 ((listp message-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2993 (eval message-signature))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2994 (t message-signature)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2995 (signature
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2996 (cond ((stringp signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2997 signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2998 ((and (eq t signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2999 message-signature-file
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3000 (file-exists-p message-signature-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3001 signature))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3002 (when signature
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3003 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3004 ;; Insert the signature.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3005 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3006 (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
3007 (when message-signature-insert-empty-line
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3008 (insert "\n"))
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3009 (insert "-- \n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3010 (if (eq signature t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3011 (insert-file-contents message-signature-file)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3012 (insert signature))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3013 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3014 (or (bolp) (insert "\n")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3015
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3016 (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
3017 "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
3018 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3019 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3020 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3021 (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
3022 (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
3023 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3024 (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
3025
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3026 (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
3027 "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
3028 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3029 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3030 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3031 (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
3032 (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
3033 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3034 (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
3035
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3036 (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
3037 "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
3038 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
3039 and `low'."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3040 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3041 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3042 (let ((valid '("high" "normal" "low"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3043 (new "high")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3044 cur)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3045 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3046 (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
3047 (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
3048 (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
3049 (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
3050 "low")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3051 ((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
3052 "normal")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3053 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3054 "high")))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3055 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3056 (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
3057
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3058 (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
3059 "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
3060 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
3061 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3062 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3063 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3064 (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
3065 (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
3066 (message-goto-eoh)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3067 (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
3068 (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
3069 (message-field-value "From")
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3070 (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
3071
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3072 (defun message-elide-region (b e)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3073 "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
3074 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
3075 text was killed."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3076 (interactive "r")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3077 (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
3078 (insert message-elide-ellipsis))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3079
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3080 (defvar message-caesar-translation-table nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3081
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3082 (defun message-caesar-region (b e &optional n)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3083 "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
3084 (interactive
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3085 (list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3086 (min (point) (or (mark t) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3087 (max (point) (or (mark t) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3088 (when current-prefix-arg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3089 (prefix-numeric-value current-prefix-arg))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3090
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3091 (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
3092 (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
3093 (= b e)) ; no region to rotate
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3094 ;; We build the table, if necessary.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3095 (when (or (not message-caesar-translation-table)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3096 (/= (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
3097 (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
3098 (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
3099 (translate-region b e message-caesar-translation-table)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3100
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3101 (defun message-make-caesar-translation-table (n)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3102 "Create a rot table with offset N."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3103 (let ((i -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3104 (table (make-string 256 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3105 (while (< (incf i) 256)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3106 (aset table i i))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3107 (concat
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3108 (substring table 0 ?A)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3109 (substring table (+ ?A n) (+ ?A n (- 26 n)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3110 (substring table ?A (+ ?A n))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3111 (substring table (+ ?A 26) ?a)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3112 (substring table (+ ?a n) (+ ?a n (- 26 n)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3113 (substring table ?a (+ ?a n))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3114 (substring table (+ ?a 26) 255))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3115
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3116 (defun message-caesar-buffer-body (&optional rotnum)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3117 "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
3118 Used to encode/decode possibly offensive messages (commonly in rec.humor).
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3119 With prefix arg, specifies the number of places to rotate each letter forward.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3120 Mail and USENET news headers are not rotated."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3121 (interactive (if current-prefix-arg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3122 (list (prefix-numeric-value current-prefix-arg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3123 (list nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3124 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3125 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3126 (when (message-goto-body)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3127 (narrow-to-region (point) (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3128 (message-caesar-region (point-min) (point-max) rotnum))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3129
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3130 (defun message-pipe-buffer-body (program)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3131 "Pipe the message body in the current buffer through PROGRAM."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3132 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3133 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3134 (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
3135 (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
3136 (shell-command-on-region
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3137 (point-min) (point-max) program nil t))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3138
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3139 (defun message-rename-buffer (&optional enter-string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3140 "Rename the *message* buffer to \"*message* RECIPIENT\".
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3141 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
3142 name, rather than giving an automatic name."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3143 (interactive "Pbuffer name: ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3144 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3145 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3146 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3147 (narrow-to-region (point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3148 (search-forward mail-header-separator nil 'end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3149 (let* ((mail-to (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3150 (if (message-news-p) (message-fetch-field "Newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3151 (message-fetch-field "To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3152 ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3153 (mail-trimmed-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3154 (if (string-match "," mail-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3155 (concat (substring mail-to 0 (match-beginning 0)) ", ...")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3156 mail-to))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3157 (name-default (concat "*message* " mail-trimmed-to))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3158 (name (if enter-string
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3159 (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
3160 name-default)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3161 (rename-buffer name t)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3162
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3163 (defun message-fill-yanked-message (&optional justifyp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3164 "Fill the paragraphs of a message yanked into this one.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3165 Numeric argument means justify as well."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3166 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3167 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3168 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3169 (search-forward (concat "\n" mail-header-separator "\n") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3170 (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
3171 (fill-individual-paragraphs (point) (point-max) justifyp))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3172
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3173 (defun message-indent-citation ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3174 "Modify text just inserted from a message to be cited.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3175 The inserted text should be the region.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3176 When this function returns, the region is again around the modified text.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3177
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3178 Normally, indent each nonblank line `message-indentation-spaces' spaces.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3179 However, 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
3180 (let ((start (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3181 ;; Remove unwanted headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3182 (when message-ignored-cited-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3183 (let (all-removed)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3184 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3185 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3186 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3187 (if (search-forward "\n\n" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3188 (1- (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3189 (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3190 (message-remove-header message-ignored-cited-headers t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3191 (when (= (point-min) (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3192 (setq all-removed t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3193 (goto-char (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3194 (if all-removed
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3195 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3196 (forward-line 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3197 ;; Delete blank lines at the start of the buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3198 (while (and (point-min)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3199 (eolp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3200 (not (eobp)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3201 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3202 ;; Delete blank lines at the end of the buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3203 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3204 (unless (eolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3205 (insert "\n"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3206 (while (and (zerop (forward-line -1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3207 (looking-at "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3208 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3209 ;; Do the indentation.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3210 (if (null message-yank-prefix)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3211 (indent-rigidly start (mark t) message-indentation-spaces)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3212 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3213 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3214 (while (< (point) (mark t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3215 (if (or (looking-at ">") (looking-at "^$"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3216 (insert message-yank-cited-prefix)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3217 (insert message-yank-prefix))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3218 (forward-line 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3219 (goto-char start)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3220
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3221 (defun message-yank-original (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3222 "Insert the message being replied to, if any.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3223 Puts point before the text and mark after.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3224 Normally indents each nonblank line ARG spaces (default 3). However,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3225 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
3226
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3227 This function uses `message-cite-function' to do the actual citing.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3228
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3229 Just \\[universal-argument] as argument means don't indent, insert no
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3230 prefix, and don't delete any headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3231 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3232 (let ((modified (buffer-modified-p)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3233 (when (and message-reply-buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3234 message-cite-function)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3235 (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
3236 (push-mark (save-excursion
4db92b217e85 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents: 64085
diff changeset
3237 (insert-buffer-substring message-reply-buffer)
4db92b217e85 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-507
Miles Bader <miles@gnu.org>
parents: 64085
diff changeset
3238 (point)))
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35147
diff changeset
3239 (unless arg
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35147
diff changeset
3240 (funcall message-cite-function))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3241 (message-exchange-point-and-mark)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3242 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3243 (insert ?\n))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3244 (unless modified
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3245 (setq message-checksum (message-checksum))))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3246
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3247 (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
3248 "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
3249 (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
3250 (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
3251 (save-window-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3252 (message-yank-original))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3253
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3254 (defun message-buffers ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3255 "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
3256 (let (buffers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3257 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3258 (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
3259 (set-buffer buffer)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3260 (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
3261 (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
3262 (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
3263 (nreverse buffers)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3264
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3265 (defun message-cite-original-without-signature ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3266 "Cite function in the standard Message manner."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3267 (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
3268 (end (mark t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3269 (functions
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3270 (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
3271 (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
3272 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
3273 (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
3274 ;; 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
3275 ;; 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
3276 ;; 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
3277 (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
3278 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3279 (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
3280 (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
3281 (vector 0
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3282 (or (message-fetch-field "subject") "none")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3283 (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
3284 (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
3285 (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
3286 (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
3287 0 0 ""))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3288 (mml-quote-region start end)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3289 ;; Allow undoing.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3290 (undo-boundary)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3291 (goto-char end)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3292 (when (re-search-backward message-signature-separator start t)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3293 ;; Also peel off any blank lines before the signature.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3294 (forward-line -1)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3295 (while (looking-at "^[ \t]*$")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3296 (forward-line -1))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3297 (forward-line 1)
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35147
diff changeset
3298 (delete-region (point) end)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35147
diff changeset
3299 (unless (search-backward "\n\n" start t)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35147
diff changeset
3300 ;; Insert a blank line if it is peeled off.
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3301 (insert "\n")))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3302 (goto-char start)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3303 (while functions
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3304 (funcall (pop functions)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3305 (when message-citation-line-function
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3306 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3307 (insert "\n"))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3308 (funcall message-citation-line-function))))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3309
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3310 (eval-when-compile (defvar mail-citation-hook)) ;Compiler directive
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3311 (defun message-cite-original ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3312 "Cite function in the standard Message manner."
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3313 (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
3314 mail-citation-hook)
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3315 (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
3316 (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
3317 (end (mark t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3318 (functions
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3319 (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
3320 (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
3321 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
3322 (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
3323 ;; 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
3324 ;; 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
3325 ;; 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
3326 (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
3327 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3328 (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
3329 (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
3330 (vector 0
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3331 (or (message-fetch-field "subject") "none")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3332 (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
3333 (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
3334 (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
3335 (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
3336 0 0 ""))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3337 (mml-quote-region start end)
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3338 (goto-char start)
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3339 (while functions
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3340 (funcall (pop functions)))
22656
e3dc0aa099e5 (message-cite-original): If mail-citation-hook
Richard M. Stallman <rms@gnu.org>
parents: 22378
diff changeset
3341 (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
3342 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3343 (insert "\n"))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3344 (funcall message-citation-line-function)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3345
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3346 (defun message-insert-citation-line ()
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3347 "Insert a simple citation line."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3348 (when message-reply-headers
67032
ebf472d3ae22 (message-insert-citation-line): Use newlines.
Chong Yidong <cyd@stupidchicken.com>
parents: 67030
diff changeset
3349 (insert (mail-header-from message-reply-headers) " writes:")
ebf472d3ae22 (message-insert-citation-line): Use newlines.
Chong Yidong <cyd@stupidchicken.com>
parents: 67030
diff changeset
3350 (newline)
ebf472d3ae22 (message-insert-citation-line): Use newlines.
Chong Yidong <cyd@stupidchicken.com>
parents: 67030
diff changeset
3351 (newline)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3352
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3353 (defun message-position-on-field (header &rest afters)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3354 (let ((case-fold-search t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3355 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3356 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3357 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3358 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3359 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3360 (concat "^" (regexp-quote mail-header-separator) "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3361 (match-beginning 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3362 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3363 (if (re-search-forward (concat "^" (regexp-quote header) ":") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3364 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3365 (re-search-forward "^[^ \t]" nil 'move)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3366 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3367 (skip-chars-backward "\n")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3368 t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3369 (while (and afters
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3370 (not (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3371 (concat "^" (regexp-quote (car afters)) ":")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3372 nil t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3373 (pop afters))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3374 (when afters
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3375 (re-search-forward "^[^ \t]" nil 'move)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3376 (beginning-of-line))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3377 (insert header ": \n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3378 (forward-char -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3379 nil))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3380
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3381 (defun message-remove-signature ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3382 "Remove the signature from the text between point and mark.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3383 The text will also be indented the normal way."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3384 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3385 (let ((start (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3386 mark)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3387 (if (not (re-search-forward message-signature-separator (mark t) t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3388 ;; No signature here, so we just indent the cited text.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3389 (message-indent-citation)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3390 ;; Find the last non-empty line.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3391 (forward-line -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3392 (while (looking-at "[ \t]*$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3393 (forward-line -1))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3394 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3395 (setq mark (set-marker (make-marker) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3396 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3397 (message-indent-citation)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3398 ;; Enable undoing the deletion.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3399 (undo-boundary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3400 (delete-region mark (mark t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3401 (set-marker mark nil)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3402
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3403
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3404
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3405 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3406 ;;; Sending messages
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3407 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3408
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3409 (defun message-send-and-exit (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3410 "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
3411 (interactive "P")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3412 (let ((buf (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3413 (actions message-exit-actions))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3414 (when (and (message-send arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3415 (buffer-name buf))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3416 (if message-kill-buffer-on-exit
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3417 (kill-buffer buf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3418 (bury-buffer buf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3419 (when (eq buf (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3420 (message-bury buf)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3421 (message-do-actions actions)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3422 t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3423
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3424 (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
3425 "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
3426 Instead, just auto-save the buffer and then bury it."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3427 (interactive)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3428 (set-buffer-modified-p t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3429 (save-buffer)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3430 (let ((actions message-postpone-actions))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3431 (message-bury (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3432 (message-do-actions actions)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3433
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3434 (defun message-kill-buffer ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3435 "Kill the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3436 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3437 (when (or (not (buffer-modified-p))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3438 (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
3439 (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
3440 (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
3441 (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
3442 (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
3443 (modified (buffer-modified-p)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3444 (setq buffer-file-name nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3445 (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
3446 (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
3447 (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
3448 (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
3449 (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
3450 (progn
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3451 ;; 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
3452 ;; `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
3453 ;; `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
3454 ;; 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
3455 ;; current frame:
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3456 (raise-frame)
bfabe4ff7114 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-512
Miles Bader <miles@gnu.org>
parents: 64712
diff changeset
3457 (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
3458 (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
3459 (ignore-errors
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3460 (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
3461 (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
3462 (message-disassociate-draft)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3463 (message-do-actions actions))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3464
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3465 (defun message-bury (buffer)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3466 "Bury this mail BUFFER."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3467 (let ((newbuf (other-buffer buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3468 (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
3469 (if (and (window-dedicated-p (selected-window))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3470 (not (null (delq (selected-frame) (visible-frame-list)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3471 (delete-frame (selected-frame))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3472 (switch-to-buffer newbuf))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3473
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3474 (defun message-send (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3475 "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
3476 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
3477 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
3478 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
3479 the mailer.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3480 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
3481 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
3482 (interactive "P")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3483 ;; 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
3484 (undo-boundary)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3485 (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
3486 (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
3487 (message-fix-before-sending)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3488 (run-hooks 'message-send-hook)
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
3489 (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
3490 (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
3491 (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
3492 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
3493 (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
3494 (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
3495 (while (and success
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3496 (setq elem (pop alist)))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
3497 (when (funcall (cadr elem))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
3498 (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
3499 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
3500 (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
3501 (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
3502 (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
3503 (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
3504 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3505 "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
3506 (car elem)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3507 (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
3508 (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
3509 (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
3510 (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
3511 (not success)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3512 (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
3513 (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
3514 (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
3515 (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
3516 (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
3517 (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
3518 (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
3519 (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
3520 (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
3521 (fcc "Fcc")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3522 (t "Gcc"))))))))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3523 (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
3524 (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
3525 (and success sent))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3526 (message-do-fcc)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3527 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3528 (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
3529 (message "Sending...done")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3530 ;; 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
3531 (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
3532 (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
3533 (message-disassociate-draft)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3534 ;; 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
3535 (message-do-send-housekeeping)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3536 (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
3537 ;; Return success.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3538 t)))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3539
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3540 (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
3541 "Send the current message via mail."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3542 (message-send-mail arg))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3543
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3544 (defun message-send-via-news (arg)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3545 "Send the current message via news."
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3546 (funcall message-send-news-function arg))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3547
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3548 (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
3549 "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
3550 `(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
3551 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3552 ,@forms)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3553
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3554 (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
3555 (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
3556
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3557 (defun message-text-with-property (prop)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3558 "Return a list of all points where the text has PROP."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3559 (let ((points nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3560 (point (point-min)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3561 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3562 (while (< point (point-max))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3563 (when (get-text-property point prop)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3564 (push point points))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3565 (incf point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3566 (nreverse points)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3567
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3568 (defun message-fix-before-sending ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3569 "Do various things to make the message nice before sending it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3570 ;; Make sure there's a newline at the end of the message.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3571 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3572 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3573 (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
3574 ;; Make the hidden headers visible.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3575 (let ((points (message-text-with-property 'message-hidden)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3576 (when points
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3577 (goto-char (car points))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3578 (dolist (point points)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3579 (add-text-properties 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
3580 '(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
3581 ;; 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
3582 ;; 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
3583 ;; 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
3584 (message-check 'invisible-text
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3585 (let ((points (message-text-with-property 'invisible)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3586 (when points
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3587 (goto-char (car points))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3588 (dolist (point points)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3589 (put-text-property point (1+ point) 'invisible nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3590 (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
3591 'face 'highlight))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3592 (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
3593 "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
3594 (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
3595 (message-check 'illegible-text
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3596 (let (found choice)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3597 (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
3598 (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
3599 (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
3600 (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
3601 (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
3602 (and (mm-multibyte-p)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3603 (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
3604 '(eight-bit-control eight-bit-graphic
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3605 control-1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3606 (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
3607 (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
3608 (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
3609 'face 'highlight)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3610 (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
3611 (forward-char)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3612 (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
3613 (when found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3614 (setq choice
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3615 (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
3616 "Non-printable characters found. Continue sending?"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3617 '((?d "Remove non-printable characters and send")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3618 (?r "Replace non-printable characters with dots and send")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3619 (?i "Ignore non-printable characters and send")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3620 (?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
3621 (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
3622 (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
3623 (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
3624 (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
3625 (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
3626 (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
3627 (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
3628 (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
3629 ;; FIXME: Wrong for Emacs 23 (unicode) and for
12d289b6e5de Revision: emacs@sv.gnu.org/emacs--devo--0--patch-118
Miles Bader <miles@gnu.org>
parents: 68521
diff changeset
3630 ;; things like undecable utf-8. Should at least
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3631 ;; use find-coding-systems-region.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3632 (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
3633 '(eight-bit-control eight-bit-graphic
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3634 control-1))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3635 (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
3636 (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
3637 (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
3638 (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
3639 (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
3640 (when (eq choice ?r)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3641 (insert "."))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3642 (forward-char)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3643 (skip-chars-forward mm-7bit-chars))))))
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-add-action (action &rest types)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3646 "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
3647 (while types
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3648 (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
3649 action)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3650
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3651 (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
3652 "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
3653 (let (var)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3654 (while types
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3655 (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
3656 (delq action (symbol-value var))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3657
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3658 (defun message-do-actions (actions)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3659 "Perform all actions in ACTIONS."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3660 ;; Now perform actions on successful sending.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3661 (while actions
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3662 (ignore-errors
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3663 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3664 ;; A simple function.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3665 ((functionp (car actions))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3666 (funcall (car actions)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3667 ;; Something to be evaled.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3668 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3669 (eval (car actions)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3670 (pop actions)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3671
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3672 (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
3673 "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
3674 ;; 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
3675 (goto-char (point-min))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
3676 (re-search-forward
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
3677 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3678 (replace-match "\n")
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
3679 (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
3680 (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
3681 (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
3682 (curbuf (current-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3683 (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
3684 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
3685 (while (not (eobp))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3686 (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
3687 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3688 (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
3689 (beginning-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3690 (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
3691 (push p plist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3692 (setq p (point)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3693 (setq total (length plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3694 (push (point-max) plist)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3695 (setq plist (nreverse plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3696 (unwind-protect
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3697 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3698 (setq p (pop plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3699 (while plist
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3700 (set-buffer curbuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3701 (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
3702 (set-buffer tembuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3703 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3704 (if header
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3705 (progn
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3706 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3707 (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
3708 (insert header))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3709 (message-goto-eoh)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3710 (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
3711 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3712 (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
3713 (insert header)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3714 (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
3715 (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
3716 (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
3717 (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
3718 (message-remove-header "Lines")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3719 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3720 (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
3721 (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
3722 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3723 (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
3724 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
3725 (forward-char -1)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3726 (let ((mail-header-separator ""))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3727 (when (memq 'Message-ID message-required-mail-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3728 (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
3729 (when (memq 'Lines message-required-mail-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3730 (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
3731 (message-goto-subject)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3732 (end-of-line)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3733 (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
3734 (widen)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3735 (mm-with-unibyte-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
3736 (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
3737 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
3738 (setq n (+ n 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3739 (setq p (pop plist))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3740 (erase-buffer)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3741 (kill-buffer tembuf))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3742
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3743 (defun message-send-mail (&optional arg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3744 (require 'mail-utils)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3745 (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
3746 (case-fold-search nil)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3747 (news (message-news-p))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3748 (mailbuf (current-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3749 (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
3750 (message-posting-charset
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3751 (if (fboundp 'gnus-setup-posting-charset)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3752 (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
3753 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
3754 (headers message-required-mail-headers))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3755 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3756 (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
3757 ;; 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
3758 (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
3759 (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
3760 (setq headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3761 (cons
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3762 (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
3763 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
3764 ;; 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
3765 (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
3766 (message-remove-header "^Mail-Followup-To:")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3767 ;; Insert some headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3768 (let ((message-deletable-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3769 (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
3770 (message-generate-headers headers))
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3771 ;; Check continuation headers.
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3772 (message-check 'continuation-headers
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3773 (goto-char (point-min))
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3774 (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
3775 (goto-char (match-beginning 0))
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3776 (if (y-or-n-p "Fix continuation lines? ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3777 (insert " ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3778 (forward-line 1)
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3779 (unless (y-or-n-p "Send anyway? ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
3780 (error "Failed to send the message")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3781 ;; Let the user do all of the above.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3782 (run-hooks 'message-header-hook))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3783 (unwind-protect
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3784 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3785 (set-buffer tembuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3786 (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
3787 ;; 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
3788 (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
3789 (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
3790 (point-min) (point-max))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3791 ;; Remove some headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3792 (message-encode-message-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3793 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3794 (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
3795 ;; 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
3796 (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
3797 (message-generate-headers '(Lines)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3798 ;; Remove some headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3799 (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
3800 (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
3801 (mail-encode-encoded-word-buffer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3802 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3803 ;; require one newline at the end.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3804 (or (= (preceding-char) ?\n)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3805 (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
3806 (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
3807 ;; 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
3808 ;; 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
3809 ;; non-ASCII characters. -- jh
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
3810 (when
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3811 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3812 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3813 (and news
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3814 (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
3815 (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
3816 (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
3817 (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
3818 "content-type")))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3819 (and
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3820 (or
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3821 (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
3822 (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
3823 (car
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3824 (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
3825 content-type))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3826 (not
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3827 (string= "base64"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3828 (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
3829 "content-transfer-encoding")))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3830 (message-insert-courtesy-copy))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3831 (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
3832 (< (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
3833 (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
3834 "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
3835 t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3836 "\
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3837 The message size, "
56947
a1a3a7ab3bad (message-tokenize-header, message-send-mail-with-qmail):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 56927
diff changeset
3838 (/ (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
3839
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3840 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
3841 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
3842 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
3843 (/ 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
3844 "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
3845 one.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3846
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3847 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
3848 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
3849 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
3850
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3851 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
3852 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
3853 `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
3854 ")))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
3855 (mm-with-unibyte-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
3856 (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
3857 (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
3858 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
3859 (message-send-mail-partially)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3860 (kill-buffer tembuf))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3861 (set-buffer mailbuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3862 (push 'mail message-sent-message-via)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3863
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3864 (defun message-send-mail-with-sendmail ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3865 "Send off the prepared buffer with sendmail."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3866 (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
3867 (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
3868 " sendmail errors")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3869 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3870 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
3871 (unwind-protect
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3872 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3873 (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
3874 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3875 (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
3876 (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
3877 ;; 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
3878 (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
3879 (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
3880 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3881 (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
3882 (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
3883 (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
3884 (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
3885 ;; 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
3886 ;; 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
3887 (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
3888 (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
3889 (newline))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3890 (when message-interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3891 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3892 (set-buffer errbuf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3893 (erase-buffer))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3894 (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
3895 (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
3896 (cpr (apply
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3897 '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
3898 (append
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3899 (list (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
3900 (if (boundp 'sendmail-program)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3901 sendmail-program
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3902 "/usr/lib/sendmail")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3903 nil errbuf nil "-oi")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3904 ;; 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
3905 ;; 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
3906 ;; 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
3907 ;; we'll let users override this.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3908 (if (null message-sendmail-f-is-evil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3909 (list "-f" (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
3910 ;; 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
3911 ;; 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
3912 (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
3913 ;; 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
3914 ;; 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
3915 ;; 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
3916 ;; 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
3917 ;; 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
3918 (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
3919 (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
3920 '("-t"))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3921 (unless (or (null cpr) (and (numberp cpr) (zerop cpr)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3922 (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
3923 (when message-interactive
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3924 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3925 (set-buffer errbuf)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3926 (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
3927 (while (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
3928 (replace-match "; "))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3929 (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
3930 (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
3931 (buffer-string))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3932 (when (bufferp errbuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3933 (kill-buffer errbuf)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3934
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3935 (defun message-send-mail-with-qmail ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3936 "Pass the prepared message buffer to qmail-inject.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3937 Refer to the documentation for the variable `message-send-mail-function'
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3938 to find out how to use this."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3939 ;; replace the header delimiter with a blank line
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3940 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3941 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3942 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
3943 (replace-match "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3944 (run-hooks 'message-send-mail-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3945 ;; send the message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3946 (case
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3947 (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
3948 (apply
56947
a1a3a7ab3bad (message-tokenize-header, message-send-mail-with-qmail):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 56927
diff changeset
3949 '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
3950 message-qmail-inject-program nil nil nil
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3951 ;; qmail-inject's default behaviour is to look for addresses on the
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3952 ;; 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
3953 ;; 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
3954 ;;
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3955 ;; 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
3956 ;; 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
3957 ;; message from stdin.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3958 ;;
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3959 ;; 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
3960 ;; 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
3961 ;; 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
3962 ;; for sendmail's lost innocence.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3963 ;;
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
3964 ;; 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
3965 ;; 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
3966 ;; 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
3967 ;; gets full control (no gestapo'ish -f's, for instance). --sj
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3968 (if (functionp message-qmail-inject-args)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3969 (funcall message-qmail-inject-args)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3970 message-qmail-inject-args)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3971 ;; qmail-inject doesn't say anything on it's stdout/stderr,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3972 ;; we have to look at the retval instead
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3973 (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
3974 (100 (error "qmail-inject reported permanent failure"))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3975 (111 (error "qmail-inject reported transient failure"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3976 ;; should never happen
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
3977 (t (error "qmail-inject reported unknown failure"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3978
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3979 (defun message-send-mail-with-mh ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3980 "Send the prepared message buffer with mh."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3981 (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
3982 (name (mh-new-draft-name)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3983 (setq buffer-file-name name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3984 ;; MH wants to generate these headers itself.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3985 (when message-mh-deletable-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3986 (let ((headers message-mh-deletable-headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3987 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3988 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3989 (and (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3990 (concat "^" (symbol-name (car headers)) ": *") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3991 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3992 (pop headers))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3993 (run-hooks 'message-send-mail-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3994 ;; Pass it on to mh.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3995 (mh-send-letter)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3996
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
3997 (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
3998 "Send the prepared message buffer with `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
3999 This only differs from `smtpmail-send-it' that this command evaluates
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4000 `message-send-mail-hook' just before sending a message. It is useful
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4001 if your ISP requires the POP-before-SMTP authentication. See the Gnus
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4002 manual for details."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4003 (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
4004 (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
4005
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4006 (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
4007 "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
4008 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
4009 (require 'sha1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4010 (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
4011 (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
4012 (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
4013 (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
4014 (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
4015
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4016 (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
4017 "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
4018 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
4019 Otherwise, generate and save a value for `canlock-password' first."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4020 (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
4021 (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
4022 (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
4023 canlock-password)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4024
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4025 (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
4026 (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
4027 (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
4028 (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
4029
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4030 (defun message-send-news (&optional arg)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4031 (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
4032 (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
4033 (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
4034 (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
4035 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
4036 (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
4037 (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
4038 (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
4039 (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
4040 (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
4041 (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
4042 ;; 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
4043 ;; 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
4044 ;; 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
4045 ;; -- 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
4046 (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
4047 (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
4048 (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
4049 (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
4050 (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
4051 (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
4052 (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
4053 (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
4054 (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
4055 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
4056 (messbuf (current-buffer))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4057 (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
4058 (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
4059 (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
4060 (cons '(existing-newsgroups . disabled)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4061 message-syntax-checks)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4062 message-syntax-checks))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4063 (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
4064 (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
4065 (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
4066 result)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4067 (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
4068 nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4069 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4070 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4071 ;; Insert some headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4072 (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
4073 (message-insert-canlock)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4074 ;; 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
4075 (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
4076 ;; 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
4077 ;; 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
4078 (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
4079 (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
4080 (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
4081 (cons '(valid-newsgroups . disabled)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4082 message-syntax-checks)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4083 (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
4084 (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
4085 (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
4086 nil
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4087 (unwind-protect
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4088 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4089 (set-buffer tembuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4090 (buffer-disable-undo)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4091 (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
4092 ;; 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
4093 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4094 (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
4095 (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
4096 (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
4097 (message-encode-message-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4098 ;; Remove some headers.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4099 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4100 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4101 ;; 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
4102 (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
4103 (message-generate-headers '(Lines)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4104 ;; Remove some headers.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4105 (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
4106 (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
4107 (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
4108 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4109 ;; 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
4110 (or (= (preceding-char) ?\n)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4111 (insert ?\n))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4112 (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
4113 ;; Remove the delimiter.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4114 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4115 (re-search-forward
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4116 (concat "^" (regexp-quote mail-header-separator) "\n"))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4117 (replace-match "\n")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4118 (backward-char 1))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4119 (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
4120 (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
4121 (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
4122 (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
4123 (gnus-request-post method))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4124 (kill-buffer tembuf))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4125 (set-buffer messbuf)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4126 (if result
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4127 (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
4128 (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
4129 (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
4130 nil)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4131
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4132 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4133 ;;; Header generation & syntax checking.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4134 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4135
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4136 (defun message-check-element (type)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
4137 "Return non-nil if this TYPE is not to be checked."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4138 (if (eq message-syntax-checks 'dont-check-for-anything-just-trust-me)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4139 t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4140 (let ((able (assq type message-syntax-checks)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4141 (and (consp able)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4142 (eq (cdr able) 'disabled)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4143
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4144 (defun message-check-news-syntax ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4145 "Check the syntax of the message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4146 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4147 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4148 (widen)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4149 ;; 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
4150 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4151 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4152 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4153 (message-check-news-header-syntax))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4154
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4155 (defun message-check-news-header-syntax ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4156 (and
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4157 ;; Check Newsgroups header.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4158 (message-check 'newsgroups
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4159 (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
4160 (or
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4161 (and group
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4162 (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
4163 (ignore
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4164 (message
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4165 "The newsgroups field is empty or missing. Posting is denied.")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4166 ;; Check the Subject header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4167 (message-check 'subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4168 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4169 (subject (message-fetch-field "subject")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4170 (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4171 (and subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4172 (not (string-match "\\`[ \t]*\\'" subject)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4173 (ignore
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4174 (message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4175 "The subject field is empty or missing. Posting is denied.")))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4176 ;; Check for commands in Subject.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4177 (message-check 'subject-cmsg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4178 (if (string-match "^cmsg " (message-fetch-field "subject"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4179 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4180 "The control code \"cmsg\" is in the subject. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4181 t))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4182 ;; 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
4183 (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
4184 (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
4185 (header nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4186 (length 0)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4187 found)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4188 (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
4189 (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
4190 (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
4191 (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
4192 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
4193 (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
4194 (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
4195 (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
4196 (if found
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4197 (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
4198 header length))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4199 t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4200 ;; Check for multiple identical headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4201 (message-check 'multiple-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4202 (let (found)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4203 (while (and (not found)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4204 (re-search-forward "^[^ \t:]+: " nil t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4205 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4206 (or (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4207 (concat "^"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4208 (regexp-quote
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4209 (setq found
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4210 (buffer-substring
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4211 (match-beginning 0) (- (match-end 0) 2))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4212 ":")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4213 nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4214 (setq found nil))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4215 (if found
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4216 (y-or-n-p (format "Multiple %s headers. Really post? " found))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4217 t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4218 ;; Check for Version and Sendsys.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4219 (message-check 'sendsys
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4220 (if (re-search-forward "^Sendsys:\\|^Version:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4221 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4222 (format "The article contains a %s command. Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4223 (buffer-substring (match-beginning 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4224 (1- (match-end 0)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4225 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4226 ;; See whether we can shorten Followup-To.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4227 (message-check 'shorten-followup-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4228 (let ((newsgroups (message-fetch-field "newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4229 (followup-to (message-fetch-field "followup-to"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4230 to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4231 (when (and newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4232 (string-match "," newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4233 (not followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4234 (not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4235 (zerop
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4236 (length
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4237 (setq to (completing-read
65682
c16795de963a 2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents: 65342
diff changeset
4238 "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
4239 (mapcar #'list
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4240 (cons "poster"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4241 (message-tokenize-header
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4242 newsgroups)))))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4243 (goto-char (point-min))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
4244 (insert "Followup-To: " to "\n"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4245 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4246 ;; Check "Shoot me".
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4247 (message-check 'shoot
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4248 (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
4249 "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
4250 (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
4251 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4252 ;; Check for Approved.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4253 (message-check 'approved
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4254 (if (re-search-forward "^Approved:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4255 (y-or-n-p "The article contains an Approved header. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4256 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4257 ;; Check the Message-ID header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4258 (message-check 'message-id
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4259 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4260 (message-id (message-fetch-field "message-id" t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4261 (or (not message-id)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4262 ;; Is there an @ in the ID?
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4263 (and (string-match "@" message-id)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4264 ;; 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
4265 (string-match "@[^.]*\\." message-id)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4266 ;; 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
4267 (not (string-match "\\.>" message-id)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4268 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4269 (format "The Message-ID looks strange: \"%s\". Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4270 message-id)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4271 ;; Check the Newsgroups & Followup-To headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4272 (message-check 'existing-newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4273 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4274 (newsgroups (message-fetch-field "newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4275 (followup-to (message-fetch-field "followup-to"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4276 (groups (message-tokenize-header
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4277 (if followup-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4278 (concat newsgroups "," followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4279 newsgroups)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4280 (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
4281 (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
4282 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
4283 ;; 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
4284 ;; 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
4285 ;; -- 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
4286 (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
4287 (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
4288 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
4289 (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
4290 (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
4291 (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
4292 (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
4293 post-method))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4294 (known-groups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4295 (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
4296 (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
4297 (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
4298 (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
4299 (gnus-groups-from-server method)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4300 errors)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4301 (while groups
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4302 (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
4303 (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
4304 (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
4305 (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
4306 (pop groups))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4307 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4308 ;; 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
4309 ((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
4310 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
4311 (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
4312 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4313 ;; 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
4314 ((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
4315 (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
4316 errors)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4317 (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
4318 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4319 "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
4320 (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
4321 (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
4322 (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
4323 ;; 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
4324 ((not errors)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4325 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4326 ;; 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
4327 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4328 (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
4329 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4330 "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
4331 (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
4332 (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
4333 (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
4334 ;; 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
4335 (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
4336 (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
4337 (let ((do-posting t))
71379
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4338 (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
4339 (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
4340 (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
4341 (insert " ")
cb6e677b13d4 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 70245
diff changeset
4342 (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
4343 (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
4344 (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
4345 do-posting))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4346 ;; Check the Newsgroups & Followup-To headers for syntax errors.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4347 (message-check 'valid-newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4348 (let ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4349 (headers '("Newsgroups" "Followup-To"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4350 header error)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4351 (while (and headers (not error))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4352 (when (setq header (mail-fetch-field (car headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4353 (if (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4354 (not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4355 (string-match
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4356 "\\`\\([-+_&.a-zA-Z0-9]+\\)?\\(,[-+_&.a-zA-Z0-9]+\\)*\\'"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4357 header))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4358 (memq
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4359 nil (mapcar
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4360 (lambda (g)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4361 (not (string-match "\\.\\'\\|\\.\\." g)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4362 (message-tokenize-header header ","))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4363 (setq error t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4364 (unless error
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4365 (pop headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4366 (if (not error)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4367 t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4368 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4369 (format "The %s header looks odd: \"%s\". Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4370 (car headers) header)))))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4371 (message-check 'repeated-newsgroups
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4372 (let ((case-fold-search t)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4373 (headers '("Newsgroups" "Followup-To"))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4374 header error groups group)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4375 (while (and headers
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4376 (not error))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4377 (when (setq header (mail-fetch-field (pop headers)))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4378 (setq groups (message-tokenize-header header ","))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4379 (while (setq group (pop groups))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4380 (when (member group groups)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4381 (setq error group
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4382 groups nil)))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4383 (if (not error)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4384 t
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4385 (y-or-n-p
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4386 (format "Group %s is repeated in headers. Really post? " error)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4387 ;; Check the From header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4388 (message-check 'from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4389 (let* ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4390 (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
4391 ad)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4392 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4393 ((not from)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4394 (message "There is no From line. Posting is denied.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4395 nil)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4396 ((or (not (string-match
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4397 "@[^\\.]*\\."
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4398 (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
4399 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
4400 (string-match "\\.\\." ad) ;larsi@ifi..uio
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4401 (string-match "@\\." ad) ;larsi@.ifi.uio
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4402 (string-match "\\.$" ad) ;larsi@ifi.uio.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4403 (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4404 (string-match "(.*).*(.*)" from)) ;(lars) (lars)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4405 (message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4406 "Denied posting -- the From looks strange: \"%s\"." from)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4407 nil)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4408 ((let ((addresses (rfc822-addresses from)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4409 (while (and addresses
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4410 (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
4411 (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
4412 addresses)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4413 (message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4414 "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
4415 nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4416 (t t))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4417 ;; 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
4418 (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
4419 (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
4420 (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
4421 ad)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4422 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4423 ((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
4424 t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4425 ((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
4426 (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
4427 (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
4428 reply-to)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4429 ((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
4430 "@[^\\.]*\\."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4431 (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
4432 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
4433 (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
4434 (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
4435 (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
4436 (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
4437 (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
4438 (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
4439 (format
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4440 "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
4441 reply-to)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4442 (t t))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4443
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4444 (defun message-check-news-body-syntax ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4445 (and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4446 ;; Check for long lines.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4447 (message-check 'long-lines
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4448 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4449 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4450 (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
4451 (forward-line 1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4452 (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
4453 (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
4454 "<#\\(/\\)?\\(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
4455 (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
4456 (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
4457 (< (- (point) p) 80)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4458 (zerop (forward-line 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4459 (or (bolp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4460 (eobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4461 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4462 "You have lines longer than 79 characters. Really post? ")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4463 ;; Check whether the article is empty.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4464 (message-check 'empty
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4465 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4466 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4467 (concat "^" (regexp-quote mail-header-separator) "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4468 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4469 (let ((b (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4470 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4471 (re-search-backward message-signature-separator nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4472 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4473 (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
4474 (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
4475 (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
4476 (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
4477 nil))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4478 ;; Check for control characters.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4479 (message-check 'control-chars
57321
3381cb76bac3 * gnus-group.el (gnus-update-group-mark-positions):
Juri Linkov <juri@jurta.org>
parents: 57243
diff changeset
4480 (if (re-search-forward
57363
ef5d2ed6459e Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-603
Miles Bader <miles@gnu.org>
parents: 57321
diff changeset
4481 (mm-string-as-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
4482 nil t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4483 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4484 "The article contains control characters. Really post? ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4485 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4486 ;; Check excessive size.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4487 (message-check 'size
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4488 (if (> (buffer-size) 60000)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4489 (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4490 (format "The article is %d octets long. Really post? "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4491 (buffer-size)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4492 t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4493 ;; Check whether any new text has been added.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4494 (message-check 'new-text
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4495 (or
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4496 (not message-checksum)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4497 (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
4498 (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
4499 (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
4500 "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
4501 (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
4502 nil)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4503 ;; Check the length of the signature.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4504 (message-check 'signature
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4505 (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
4506 (if (> (count-lines (point) (point-max)) 5)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4507 (y-or-n-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4508 (format
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4509 "Your .sig is %d lines; it should be max 4. Really post? "
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4510 (1- (count-lines (point) (point-max)))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4511 t))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4512 ;; 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
4513 (message-check 'quoting-style
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4514 (goto-char (point-max))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4515 (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
4516 (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
4517 (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
4518 (if no-problem
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4519 t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4520 (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
4521 (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
4522 ;; Ensure that
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4523 (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
4524 (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
4525 (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
4526 (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
4527 (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
4528 (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
4529 nil)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4530
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4531 (defun message-checksum ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4532 "Return a \"checksum\" for the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4533 (let ((sum 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4534 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4535 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4536 (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4537 (concat "^" (regexp-quote mail-header-separator) "$"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4538 (while (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4539 (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
4540 (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
4541 (char-after))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4542 (forward-char 1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4543 sum))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4544
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4545 (defun message-do-fcc ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4546 "Process Fcc headers in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4547 (let ((case-fold-search t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4548 (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
4549 list file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4550 (mml-externalize-attachments message-fcc-externalize-attachments))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4551 (save-excursion
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4552 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4553 (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
4554 (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
4555 (when file
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4556 (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
4557 (erase-buffer)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4558 (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
4559 (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
4560 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4561 (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
4562 (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
4563 (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
4564 (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
4565 (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
4566 (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
4567 (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
4568 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
4569 (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
4570 (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
4571 (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
4572 (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
4573 nil t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4574 (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
4575 ;; 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
4576 (while list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4577 (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
4578 (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
4579 ;; 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
4580 (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
4581 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
4582 (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
4583 ;; 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
4584 (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
4585 (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
4586 (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
4587 (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
4588 (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
4589 (funcall message-fcc-handler-function file)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4590 (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
4591 (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
4592 (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
4593 (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
4594 (kill-buffer (current-buffer))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4595
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4596 (defun message-output (filename)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
4597 "Append this article to Unix/babyl mail file FILENAME."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4598 (if (and (file-readable-p filename)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4599 (mail-file-babyl-p filename))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4600 (gnus-output-to-rmail filename t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4601 (gnus-output-to-mail filename t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4602
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4603 (defun message-cleanup-headers ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4604 "Do various automatic cleanups of the headers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4605 ;; Remove empty lines in the header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4606 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4607 (message-narrow-to-headers)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4608 ;; Remove blank lines.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4609 (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
4610 (replace-match "" t t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4611
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4612 ;; 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
4613 ;; 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
4614 ;; embedded line breaks.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4615 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4616 (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
4617 (save-restriction
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4618 (narrow-to-region
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4619 (point)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4620 (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
4621 (match-beginning 0)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4622 (forward-line 1)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4623 (point)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4624 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4625 (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
4626 (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
4627 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4628 (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
4629 (replace-match "," t t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4630 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4631 ;; Remove trailing commas.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4632 (when (re-search-forward ",+$" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4633 (replace-match "" t t))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4634
61462
7296705f27fd (message-make-date): Handle byte-compiler warnings differently.
Lute Kamstra <lute@gnu.org>
parents: 61304
diff changeset
4635 (eval-when-compile (require 'parse-time))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4636 (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
4637 "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
4638 If NOW, use that time instead."
60655
8683c8415fd9 (message-make-date): Require parse-time.
Lute Kamstra <lute@gnu.org>
parents: 60390
diff changeset
4639 (require 'parse-time)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4640 (let* ((now (or now (current-time)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4641 (zone (nth 8 (decode-time now)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4642 (sign "+"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4643 (when (< zone 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4644 (setq sign "-")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4645 (setq zone (- zone)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4646 (concat
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4647 ;; The day name of the %a spec is locale-specific. Pfff.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4648 (format "%s, " (capitalize (car (rassoc (nth 6 (decode-time now))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4649 parse-time-weekdays))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4650 (format-time-string "%d" now)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4651 ;; The month name of the %b spec is locale-specific. Pfff.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4652 (format " %s "
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4653 (capitalize (car (rassoc (nth 4 (decode-time now))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4654 parse-time-months))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4655 (format-time-string "%Y %H:%M:%S " now)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4656 ;; We do all of this because XEmacs doesn't have the %z spec.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4657 (format "%s%02d%02d" sign (/ zone 3600) (/ (% zone 3600) 60)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4658
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4659 (defun message-make-message-id ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4660 "Make a unique Message-ID."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4661 (concat "<" (message-unique-id)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4662 (let ((psubject (save-excursion (message-fetch-field "subject")))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4663 (psupersedes
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4664 (save-excursion (message-fetch-field "supersedes"))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4665 (if (or
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4666 (and message-reply-headers
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4667 (mail-header-references message-reply-headers)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4668 (mail-header-subject message-reply-headers)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4669 psubject
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4670 (not (string=
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4671 (message-strip-subject-re
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4672 (mail-header-subject message-reply-headers))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4673 (message-strip-subject-re psubject))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4674 (and psupersedes
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
4675 (string-match "_-_@" psupersedes)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4676 "_-_" ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4677 "@" (message-make-fqdn) ">"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4678
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4679 (defvar message-unique-id-char nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4680
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4681 ;; If you ever change this function, make sure the new version
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4682 ;; cannot generate IDs that the old version could.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4683 ;; You might for example insert a "." somewhere (not next to another dot
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4684 ;; or string boundary), or modify the "fsf" string.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4685 (defun message-unique-id ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4686 ;; Don't use microseconds from (current-time), they may be unsupported.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4687 ;; Instead we use this randomly inited counter.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4688 (setq message-unique-id-char
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4689 (% (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
4690 ;; (current-time) returns 16-bit ints,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4691 ;; and 2^16*25 just fits into 4 digits i base 36.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4692 (* 25 25)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4693 (let ((tm (current-time)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4694 (concat
69572
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 69135
diff changeset
4695 (if (or (memq system-type '(ms-dos emx vax-vms))
b4faac2800dd Revision: emacs@sv.gnu.org/emacs--devo--0--patch-163
Miles Bader <miles@gnu.org>
parents: 69135
diff changeset
4696 ;; 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
4697 (floatp (user-uid)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4698 (let ((user (downcase (user-login-name))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4699 (while (string-match "[^a-z0-9_]" user)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4700 (aset user (match-beginning 0) ?_))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4701 user)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4702 (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
4703 (message-number-base36 (+ (car tm)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4704 (lsh (% message-unique-id-char 25) 16)) 4)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4705 (message-number-base36 (+ (nth 1 tm)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4706 (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
4707 ;; 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
4708 ;; 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
4709 ;; the same ID via another algorithm.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4710 ".fsf")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4711
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4712 (defun message-number-base36 (num len)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4713 (if (if (< len 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4714 (<= num 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4715 (= len 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4716 ""
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4717 (concat (message-number-base36 (/ num 36) (1- len))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4718 (char-to-string (aref "zyxwvutsrqponmlkjihgfedcba9876543210"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4719 (% num 36))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4720
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4721 (defun message-make-organization ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4722 "Make an Organization header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4723 (let* ((organization
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
4724 (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
4725 (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
4726 (funcall message-user-organization)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
4727 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
4728 (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
4729 (mm-enable-multibyte)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4730 (cond ((stringp organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4731 (insert organization))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4732 ((and (eq t organization)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4733 message-user-organization-file
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4734 (file-exists-p message-user-organization-file))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4735 (insert-file-contents message-user-organization-file)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4736 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4737 (while (re-search-forward "[\t\n]+" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4738 (replace-match "" t t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4739 (unless (zerop (buffer-size))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4740 (buffer-string)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4741
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4742 (defun message-make-lines ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4743 "Count the number of lines and return numeric string."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4744 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4745 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4746 (widen)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4747 (message-goto-body)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4748 (int-to-string (count-lines (point) (point-max))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4749
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4750 (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
4751 "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
4752 (when 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
4753 (let ((message-id (mail-header-message-id 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
4754 (references (mail-header-references 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
4755 new-references)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4756 (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
4757 (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
4758 (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
4759 nil))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4760
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4761 (defun message-make-in-reply-to ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4762 "Return the In-Reply-To header for this message."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4763 (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
4764 (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
4765 (date (mail-header-date 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
4766 (msg-id (mail-header-message-id 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
4767 (when from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4768 (let ((name (mail-extract-address-components from)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4769 (concat msg-id (if msg-id " (")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4770 (or (car name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4771 (nth 1 name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4772 "'s message of \""
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4773 (if (or (not date) (string= date ""))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4774 "(unknown date)" date)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4775 "\"" (if msg-id ")")))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4776
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4777 (defun message-make-distribution ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4778 "Make a Distribution header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4779 (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
4780 (cond ((functionp message-distribution-function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4781 (funcall message-distribution-function))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4782 (t orig-distribution))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4783
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4784 (defun message-make-expires ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4785 "Return an Expires header based on `message-expires'."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4786 (let ((current (current-time))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4787 (future (* 1.0 message-expires 60 60 24)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4788 ;; Add the future to current.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4789 (setcar current (+ (car current) (round (/ future (expt 2 16)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4790 (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
4791 (message-make-date current)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4792
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4793 (defun message-make-path ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4794 "Return uucp path."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4795 (let ((login-name (user-login-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4796 (cond ((null message-user-path)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4797 (concat (system-name) "!" login-name))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4798 ((stringp message-user-path)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4799 ;; Support GENERICPATH. Suggested by vixie@decwrl.dec.com.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4800 (concat message-user-path "!" login-name))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4801 (t login-name))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4802
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4803 (defun message-make-from ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4804 "Make a From header."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4805 (let* ((style message-from-style)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4806 (login (message-make-address))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4807 (fullname
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4808 (or (and (boundp 'user-full-name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4809 user-full-name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4810 (user-full-name))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4811 (when (string= fullname "&")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4812 (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
4813 (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
4814 (mm-enable-multibyte)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4815 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4816 ((or (null style)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4817 (equal fullname ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4818 (insert login))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4819 ((or (eq style 'angles)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4820 (and (not (eq style 'parens))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4821 ;; Use angles if no quoting is needed, or if parens would
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4822 ;; need quoting too.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4823 (or (not (string-match "[^- !#-'*+/-9=?A-Z^-~]" fullname))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4824 (let ((tmp (concat fullname nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4825 (while (string-match "([^()]*)" tmp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4826 (aset tmp (match-beginning 0) ?-)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4827 (aset tmp (1- (match-end 0)) ?-))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4828 (string-match "[\\()]" tmp)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4829 (insert fullname)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4830 (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
4831 ;; Look for a character that cannot appear unquoted
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4832 ;; according to RFC 822.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4833 (when (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]" nil 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4834 ;; Quote fullname, escaping specials.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4835 (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
4836 (insert "\"")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4837 (while (re-search-forward "[\"\\]" nil 1)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4838 (replace-match "\\\\\\&" t))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4839 (insert "\""))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4840 (insert " <" login ">"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4841 (t ; 'parens or default
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4842 (insert login " (")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4843 (let ((fullname-start (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4844 (insert fullname)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4845 (goto-char fullname-start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4846 ;; RFC 822 says \ and nonmatching parentheses
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4847 ;; must be escaped in comments.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4848 ;; Escape every instance of ()\ ...
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4849 (while (re-search-forward "[()\\]" nil 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4850 (replace-match "\\\\\\&" t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4851 ;; ... then undo escaping of matching parentheses,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4852 ;; including matching nested parentheses.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4853 (goto-char fullname-start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4854 (while (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4855 "\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4856 nil 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4857 (replace-match "\\1(\\3)" t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4858 (goto-char fullname-start)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4859 (insert ")")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4860 (buffer-string))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4861
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4862 (defun message-make-sender ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4863 "Return the \"real\" user address.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4864 This function tries to ignore all user modifications, and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4865 give as trustworthy answer as possible."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4866 (concat (user-login-name) "@" (system-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4867
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4868 (defun message-make-address ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4869 "Make the address of the user."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4870 (or (message-user-mail-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4871 (concat (user-login-name) "@" (message-make-domain))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4872
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4873 (defun message-user-mail-address ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4874 "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
4875 (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
4876 (string-match "@.*\\." user-mail-address))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4877 (if (string-match " " user-mail-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4878 (nth 1 (mail-extract-address-components user-mail-address))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4879 user-mail-address)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4880
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4881 (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
4882 "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
4883 (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
4884 (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
4885 (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
4886 ((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
4887 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
4888 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4889 (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
4890
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4891 (defun message-make-fqdn ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4892 "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
4893 (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
4894 (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
4895 (user-domain
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4896 (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
4897 (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
4898 (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
4899 (case-fold-search t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4900 (cond
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4901 ((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
4902 (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
4903 (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
4904 (not (string-match message-bogus-system-names 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
4905 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
4906 ;; `message-user-fqdn' seems to be valid
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4907 ((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
4908 (not (string-match message-bogus-system-names system-name)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4909 ;; `system-name' returned the right result.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4910 system-name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4911 ;; Try `mail-host-address'.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4912 ((and (boundp 'mail-host-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4913 (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
4914 (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
4915 (not (string-match message-bogus-system-names mail-host-address)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4916 mail-host-address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4917 ;; 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
4918 ((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
4919 (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
4920 (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
4921 (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
4922 user-domain)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4923 ;; Default to this bogus thing.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4924 (t
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4925 (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
4926 ".i-did-not-set--mail-host-address--so-tickle-me")))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4927
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4928 (defun message-make-host-name ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4929 "Return the name of the host."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4930 (let ((fqdn (message-make-fqdn)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4931 (string-match "^[^.]+\\." fqdn)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4932 (substring fqdn 0 (1- (match-end 0)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4933
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4934 (defun message-make-domain ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4935 "Return the domain name."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4936 (or mail-host-address
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4937 (message-make-fqdn)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4938
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4939 (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
4940 "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
4941 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
4942 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4943 (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
4944 (when listaddr
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4945 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4946 (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
4947 (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
4948 (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
4949 (insert listaddr)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4950
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4951 (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
4952 "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
4953 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
4954 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
4955 (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
4956 (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
4957 (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
4958 (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
4959 (recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4960 (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
4961 (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
4962 (file-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4963 (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
4964 (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
4965 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4966 (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
4967 (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
4968 (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
4969 (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
4970 (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
4971 (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
4972 (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
4973 (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
4974 (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
4975 (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
4976 (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
4977 (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
4978 (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
4979 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
4980 file-regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4981 (mapcar 'funcall
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4982 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
4983 (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
4984 (let ((subscribed-lists nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4985 (list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4986 (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
4987 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
4988 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
4989 return recipient)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4990 (when list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4991 (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
4992 list
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4993 msg-recipients))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4994
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
4995 (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
4996 "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
4997 (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
4998 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
4999 (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
5000 (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
5001 (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
5002 (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) ""))
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5003 (mapcar 'downcase
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5004 (mapcar
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5005 'car (mail-header-parse-addresses field))))))
5265a4059126 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-564
Miles Bader <miles@gnu.org>
parents: 65682
diff changeset
5006 (setq ace (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
5007 (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
5008 (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
5009 (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
5010 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
5011 (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
5012 (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
5013 (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
5014 (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
5015 (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
5016 (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
5017 (widen)))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5018
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5019 (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
5020 "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
5021 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
5022 (interactive)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5023 (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
5024 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5025 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5026 (message-narrow-to-head)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5027 (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
5028 (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
5029 (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
5030 (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
5031 (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
5032 (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
5033
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5034 (defun message-generate-headers (headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5035 "Prepare article HEADERS.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5036 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
5037 (setq headers (append headers message-required-headers))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5038 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5039 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5040 (let* ((Date (message-make-date))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5041 (Message-ID (message-make-message-id))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5042 (Organization (message-make-organization))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5043 (From (message-make-from))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5044 (Path (message-make-path))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5045 (Subject nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5046 (Newsgroups nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5047 (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
5048 (References (message-make-references))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5049 (To nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5050 (Distribution (message-make-distribution))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5051 (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
5052 (User-Agent message-newsreader)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5053 (Expires (message-make-expires))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5054 (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
5055 (optionalp nil)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5056 header value elem header-string)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5057 ;; First we remove any old generated headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5058 (let ((headers message-deletable-headers))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5059 (unless (buffer-modified-p)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5060 (setq headers (delq 'Message-ID (copy-sequence headers))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5061 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5062 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5063 (and (re-search-forward
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5064 (concat "^" (symbol-name (car headers)) ": *") nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5065 (get-text-property (1+ (match-beginning 0)) 'message-deletable)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5066 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5067 (pop headers)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5068 ;; 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
5069 ;; articles already. If they are not, or are empty, they are
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5070 ;; inserted automatically - except for Subject, Newsgroups and
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5071 ;; Distribution.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5072 (while headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5073 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5074 (setq elem (pop headers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5075 (if (consp elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5076 (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
5077 (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
5078 optionalp t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5079 (setq header (car elem)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5080 (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
5081 (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
5082 header
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5083 (symbol-name header)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5084 (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
5085 (concat "^"
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5086 (regexp-quote (downcase header-string))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5087 ":")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5088 nil t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5089 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5090 ;; The header was found. We insert a space after the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5091 ;; 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
5092 (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
5093 ;; 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
5094 (looking-at "[ \t]*\n[^ \t]")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5095 ;; So we find out what value we should insert.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5096 (setq value
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5097 (cond
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5098 ((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
5099 (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
5100 (not (member header-string message-inserted-headers)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5101 ;; This is an optional header. If the cdr of this
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5102 ;; is something that is nil, then we do not insert
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5103 ;; this header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5104 (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
5105 (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
5106 (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
5107 (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
5108 (symbol-value (cdr elem)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5109 ((consp elem)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5110 ;; The element is a cons. Either the cdr is a
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5111 ;; string to be inserted verbatim, or it is a
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5112 ;; function, and we insert the value returned from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5113 ;; 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
5114 (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
5115 (cdr elem))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5116 (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
5117 (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
5118 ((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
5119 (symbol-value header))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5120 ;; The element is a symbol. We insert the value
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5121 ;; of this symbol, if any.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5122 (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
5123 ((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
5124 (intern (downcase (symbol-name header)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5125 ;; We couldn't generate a value for this header,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5126 ;; so we just ask the user.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5127 (read-from-minibuffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5128 (format "Empty header for %s; enter value: " header)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5129 ;; Finally insert the header.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5130 (when (and value
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5131 (not (equal value "")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5132 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5133 (if (bolp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5134 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5135 ;; This header didn't exist, so we insert it.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5136 (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
5137 (let ((formatter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5138 (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
5139 (if formatter
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5140 (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
5141 (insert header-string ": " value))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5142 ;; We check whether the value was ended by a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5143 ;; newline. If now, we insert one.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5144 (unless (bolp)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5145 (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
5146 (forward-line -1)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5147 ;; The value of this header was empty, so we clear
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5148 ;; totally and insert the new value.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5149 (delete-region (point) (gnus-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
5150 ;; If the header is optional, and the header was
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5151 ;; empty, we con't insert it anyway.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5152 (unless optionalp
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5153 (push header-string message-inserted-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5154 (insert value)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5155 ;; Add the deletable property to the headers that require it.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5156 (and (memq header message-deletable-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5157 (progn (beginning-of-line) (looking-at "[^:]+: "))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5158 (add-text-properties
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5159 (point) (match-end 0)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5160 '(message-deletable t face italic) (current-buffer)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5161 ;; Insert new Sender if the From is strange.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5162 (let ((from (message-fetch-field "from"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5163 (sender (message-fetch-field "sender"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5164 (secure-sender (message-make-sender)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5165 (when (and from
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5166 (not (message-check-element 'sender))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5167 (not (string=
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5168 (downcase
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5169 (cadr (mail-extract-address-components from)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5170 (downcase secure-sender)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5171 (or (null sender)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5172 (not
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5173 (string=
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5174 (downcase
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5175 (cadr (mail-extract-address-components sender)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5176 (downcase secure-sender)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5177 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5178 ;; Rename any old Sender headers to Original-Sender.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5179 (when (re-search-forward "^\\(Original-\\)*Sender:" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5180 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5181 (insert "Original-")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5182 (beginning-of-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5183 (when (or (message-news-p)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5184 (string-match "@.+\\.." secure-sender))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5185 (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
5186 ;; 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
5187 (message-idna-to-ascii-rhs))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5188
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5189 (defun message-insert-courtesy-copy ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5190 "Insert a courtesy message in mail copies of combined messages."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5191 (let (newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5192 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5193 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5194 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5195 (when (setq newsgroups (message-fetch-field "newsgroups"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5196 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5197 (insert "Posted-To: " newsgroups "\n")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5198 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5199 (when message-courtesy-message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5200 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5201 ((string-match "%s" message-courtesy-message)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5202 (insert (format message-courtesy-message newsgroups)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5203 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5204 (insert message-courtesy-message)))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5205
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5206 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5207 ;;; Setting up a message buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5208 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5209
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5210 (defun message-fill-address (header value)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5211 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5212 (narrow-to-region (point) (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5213 (insert (capitalize (symbol-name header))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5214 ": "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5215 (if (consp value) (car value) value)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5216 "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5217 (narrow-to-region (point-min) (1- (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5218 (let (quoted last)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5219 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5220 (while (not (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5221 (skip-chars-forward "^,\"" (point-max))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5222 (if (or (eq (char-after) ?,)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5223 (eobp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5224 (when (not quoted)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5225 (if (and (> (current-column) 78)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5226 last)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5227 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5228 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5229 (goto-char last)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5230 (insert "\n\t"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5231 (setq last (1+ (point))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5232 (setq last (1+ (point)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5233 (setq quoted (not quoted)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5234 (unless (eobp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5235 (forward-char 1))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5236 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5237 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5238 (forward-line 1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5239
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5240 (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
5241 "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
5242 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
5243 (interactive "*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5244 (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
5245 (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
5246 (error
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5247 (split-line))))
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59756
diff changeset
5248
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5249 (defun message-fill-header (header value)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5250 (let ((begin (point))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5251 (fill-column 78)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5252 (fill-prefix "\t"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5253 (insert (capitalize (symbol-name header))
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 (if (consp value) (car value) value)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5256 "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5257 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5258 (narrow-to-region begin (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5259 (fill-region-as-paragraph begin (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5260 ;; Tapdance around looong Message-IDs.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5261 (forward-line -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5262 (when (looking-at "[ \t]*$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5263 (message-delete-line))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5264 (goto-char begin)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5265 (re-search-forward ":" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5266 (when (looking-at "\n[ \t]+")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5267 (replace-match " " t t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5268 (goto-char (point-max)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5269
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5270 (defun message-shorten-1 (list cut surplus)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
5271 "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
5272 (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
5273 (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
5274
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5275 (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
5276 "Trim REFERENCES to be 21 Message-ID long or less, and fold them.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5277 If folding is disallowed, also check that the REFERENCES are less
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5278 than 988 characters long, and if they are not, trim them until they are."
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5279 (let ((maxcount 21)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5280 (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
5281 (cut 2)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5282 refs)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5283 (with-temp-buffer
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5284 (insert references)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5285 (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
5286 ;; Cons a list of valid references.
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5287 (while (re-search-forward "<[^>]+>" nil t)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5288 (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
5289 (setq refs (nreverse refs)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5290 count (length refs)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5291
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5292 ;; 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
5293 ;; 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
5294 ;; elements that follow.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5295 (when (> count maxcount)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5296 (let ((surplus (- count maxcount)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5297 (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
5298 (decf count surplus)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5299
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5300 ;; If folding is disallowed, make sure the total length (including
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5301 ;; the spaces between) will be less than MAXSIZE characters.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5302 ;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5303 ;; Only disallow folding for News messages. At this point the headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5304 ;; have not been generated, thus we use message-this-is-news directly.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5305 (when (and message-this-is-news message-cater-to-broken-inn)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5306 (let ((maxsize 988)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5307 (totalsize (+ (apply #'+ (mapcar #'length refs))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5308 (1- count)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5309 (surplus 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5310 (ptr (nthcdr (1- cut) refs)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5311 ;; Decide how many elements to cut off...
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5312 (while (> totalsize maxsize)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5313 (decf totalsize (1+ (length (car ptr))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5314 (incf surplus)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5315 (setq ptr (cdr ptr)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5316 ;; ...and do it.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5317 (when (> surplus 0)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5318 (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
5319
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5320 ;; 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
5321 ;; it into the buffer.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5322 (let ((refstring (mapconcat #'identity refs " ")))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5323 (if (and message-this-is-news message-cater-to-broken-inn)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5324 (insert (capitalize (symbol-name header)) ": "
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5325 refstring "\n")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5326 (message-fill-header header refstring)))))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5327
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5328 (defun message-position-point ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5329 "Move point to where the user probably wants to find it."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5330 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5331 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5332 ((re-search-forward "^[^:]+:[ \t]*$" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5333 (search-backward ":" )
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5334 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5335 (forward-char 1)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5336 (if (eq (char-after) ? )
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5337 (forward-char 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5338 (insert " ")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5339 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5340 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5341 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5342 (forward-line 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5343 (unless (looking-at "$")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5344 (forward-line 2)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5345 (sit-for 0)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5346
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5347 (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
5348 "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
5349 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
5350 :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
5351 :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
5352 :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
5353 :type 'boolean)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5354
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5355 (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
5356 "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
5357 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
5358
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5359 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
5360 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
5361 is nil.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5362
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5363 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
5364 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
5365 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
5366 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
5367 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
5368 (interactive "p")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5369 (let ((zrs 'zmacs-region-stays))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5370 (when (and (interactive-p) (boundp zrs))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5371 (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
5372 (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
5373 (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
5374 (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
5375 (bol (progn (beginning-of-line n) (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5376 (eol (gnus-point-at-eol))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5377 (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
5378 (goto-char
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
5379 (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
5380 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
5381 (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
5382
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5383 (defun message-buffer-name (type &optional to group)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5384 "Return a new (unique) buffer name based on TYPE and TO."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5385 (cond
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5386 ;; Generate a new buffer name The Message Way.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5387 ((eq message-generate-new-buffers 'unique)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5388 (generate-new-buffer-name
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5389 (concat "*" type
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5390 (if to
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5391 (concat " to "
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5392 (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
5393 to) "")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5394 "")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5395 (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
5396 "*")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5397 ;; Check whether `message-generate-new-buffers' is a function,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5398 ;; 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
5399 ((functionp message-generate-new-buffers)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5400 (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
5401 ((eq message-generate-new-buffers 'unsent)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5402 (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
5403 (concat "*unsent " type
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5404 (if to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5405 (concat " to "
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5406 (or (car (mail-extract-address-components to))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5407 to) "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5408 "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5409 (if (and group (not (string= group ""))) (concat " on " group) "")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5410 "*")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5411 ;; Use standard name.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5412 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5413 (format "*%s message*" type))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5414
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5415 (defun message-pop-to-buffer (name)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5416 "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
5417 (let ((buffer (get-buffer name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5418 (if (and buffer
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5419 (buffer-name buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5420 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5421 (set-buffer (pop-to-buffer buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5422 (when (and (buffer-modified-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5423 (not (y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5424 "Message already being composed; erase? ")))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5425 (error "Message being composed")))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5426 (set-buffer (pop-to-buffer name)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5427 (erase-buffer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5428 (message-mode)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5429
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5430 (defun message-do-send-housekeeping ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5431 "Kill old message buffers."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5432 ;; We might have sent this buffer already. Delete it from the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5433 ;; list of buffers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5434 (setq message-buffer-list (delq (current-buffer) message-buffer-list))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5435 (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
5436 message-buffer-list
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5437 (>= (length message-buffer-list) message-max-buffers))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5438 ;; Kill the oldest buffer -- unless it has been changed.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5439 (let ((buffer (pop message-buffer-list)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5440 (when (and (buffer-name buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5441 (not (buffer-modified-p buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5442 (kill-buffer buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5443 ;; Rename the buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5444 (if message-send-rename-function
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5445 (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
5446 ;; 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
5447 (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
5448 "\\`\\*\\(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
5449 (buffer-name))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5450 (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
5451 to group)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5452 (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
5453 (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
5454 (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
5455 (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
5456 (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
5457 (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
5458 (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
5459 (widen)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5460 (setq name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5461 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5462 (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
5463 (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
5464 to) "*"))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5465 ((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
5466 (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
5467 (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
5468 (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
5469 (rename-buffer name t)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5470 ;; Push the current buffer onto the list.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5471 (when message-max-buffers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5472 (setq message-buffer-list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5473 (nconc message-buffer-list (list (current-buffer))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5474
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5475 (defun message-mail-user-agent ()
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5476 (let ((mua (cond
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5477 ((not message-mail-user-agent) nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5478 ((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
5479 (t message-mail-user-agent))))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5480 (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
5481 nil
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5482 mua)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5483
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5484 (defun message-setup (headers &optional replybuffer actions switch-function)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5485 (let ((mua (message-mail-user-agent))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5486 subject to field yank-action)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5487 (if (not (and message-this-is-mail mua))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5488 (message-setup-1 headers replybuffer actions)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5489 (if replybuffer
34859
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5490 (setq yank-action (list 'insert-buffer replybuffer)))
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5491 (setq headers (copy-sequence headers))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5492 (setq field (assq 'Subject headers))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5493 (when field
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5494 (setq subject (cdr field))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5495 (setq headers (delq field headers)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5496 (setq field (assq 'To headers))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5497 (when field
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5498 (setq to (cdr field))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5499 (setq headers (delq field headers)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5500 (let ((mail-user-agent mua))
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
5501 (compose-mail to subject
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5502 (mapcar (lambda (item)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5503 (cons
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5504 (format "%s" (car item))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5505 (cdr item)))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5506 headers)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
5507 nil switch-function yank-action actions)))))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49034
diff changeset
5508
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5509 (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
5510 "Return a list that includes all headers from HEADERS.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5511 If INCLUDED-HEADERS is a list, just include those headers. If if is
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5512 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
5513 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
5514 (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
5515 header-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5516 (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
5517 (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
5518 ((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
5519 (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
5520 ;; 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
5521 (cdr header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5522 ((consp header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5523 ;; 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
5524 (car header))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5525 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5526 ;; 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
5527 header)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5528 (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
5529 (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
5530 (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
5531 (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
5532 (nreverse result)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5533
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5534 (defun message-setup-1 (headers &optional replybuffer actions)
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
5535 (dolist (action actions)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
5536 (condition-case nil
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
5537 (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
5538 `(apply ',(car action) ',(cdr action)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5539 (setq message-reply-buffer replybuffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5540 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5541 ;; Insert all the headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5542 (mail-header-format
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5543 (let ((h headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5544 (alist message-header-format-alist))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5545 (while h
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5546 (unless (assq (caar h) message-header-format-alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5547 (push (list (caar h)) alist))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5548 (pop h))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5549 alist)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5550 headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5551 (delete-region (point) (progn (forward-line -1) (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5552 (when message-default-headers
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5553 (insert message-default-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5554 (or (bolp) (insert ?\n)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5555 (put-text-property
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5556 (point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5557 (progn
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5558 (insert mail-header-separator "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5559 (1- (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5560 'read-only nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5561 (forward-line -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5562 (when (message-news-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5563 (when message-default-news-headers
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5564 (insert message-default-news-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5565 (or (bolp) (insert ?\n)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5566 (when message-generate-headers-first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5567 (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
5568 (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
5569 (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
5570 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
5571 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
5572 '(Lines Subject)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5573 (when (message-mail-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5574 (when message-default-mail-headers
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5575 (insert message-default-mail-headers)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
5576 (or (bolp) (insert ?\n)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5577 (when message-generate-headers-first
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5578 (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
5579 (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
5580 (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
5581 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
5582 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
5583 '(Lines Subject)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5584 (run-hooks 'message-signature-setup-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5585 (message-insert-signature)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5586 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5587 (message-narrow-to-headers)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5588 (run-hooks 'message-header-setup-hook))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5589 (set-buffer-modified-p nil)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
5590 (setq buffer-undo-list nil)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5591 (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
5592 ;; 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
5593 (when (message-mail-p)
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
5594 (save-restriction
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
5595 (message-narrow-to-headers)
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
5596 (if message-alternative-emails
04c2548593f7 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-33
Miles Bader <miles@gnu.org>
parents: 68230
diff changeset
5597 (message-use-alternative-email-as-from))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5598 (message-position-point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5599 (undo-boundary))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5600
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5601 (defun message-set-auto-save-file-name ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5602 "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
5603 (when message-auto-save-directory
34057
98bd49d8cf7d (message-auto-save-directory): Use
Dave Love <fx@gnu.org>
parents: 33982
diff changeset
5604 (unless (file-directory-p
98bd49d8cf7d (message-auto-save-directory): Use
Dave Love <fx@gnu.org>
parents: 33982
diff changeset
5605 (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
5606 (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
5607 (if (gnus-alive-p)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5608 (setq message-draft-article
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5609 (nndraft-request-associate-buffer "drafts"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5610 (setq buffer-file-name (expand-file-name
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5611 (if (memq system-type
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5612 '(ms-dos ms-windows windows-nt
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5613 cygwin cygwin32 win32 w32
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5614 mswindows))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5615 "message"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5616 "*message*")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5617 message-auto-save-directory))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5618 (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
5619 (clear-visited-file-modtime)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5620 (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
5621
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5622 (defun message-disassociate-draft ()
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5623 "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
5624 (when message-draft-article
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5625 (nndraft-request-expire-articles
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5626 (list message-draft-article) "drafts" nil t)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5627
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5628 (defun message-insert-headers ()
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5629 "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
5630 (interactive)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5631 (save-excursion
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5632 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5633 (message-narrow-to-headers)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5634 (when (message-news-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5635 (message-generate-headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5636 (delq 'Lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5637 (delq 'Subject
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5638 (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
5639 (when (message-mail-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5640 (message-generate-headers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5641 (delq 'Lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5642 (delq 'Subject
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5643 (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
5644
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5645
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5646
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5647 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5648 ;;; Commands for interfacing with message
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5649 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5650
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5651 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5652 (defun message-mail (&optional to subject
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5653 other-headers continue switch-function
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5654 yank-action send-actions)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5655 "Start editing a mail message to be sent.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5656 OTHER-HEADERS is an alist of header/value pairs."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5657 (interactive)
34859
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5658 (let ((message-this-is-mail t) replybuffer)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5659 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5660 (message-pop-to-buffer (message-buffer-name "mail" to)))
34859
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5661 ;; FIXME: message-mail should do something if YANK-ACTION is not
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5662 ;; insert-buffer.
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5663 (and (consp yank-action) (eq (car yank-action) 'insert-buffer)
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5664 (setq replybuffer (nth 1 yank-action)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5665 (message-setup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5666 (nconc
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5667 `((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
5668 (when other-headers other-headers))
41750
a96c3ddfa03e 2001-12-01 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41511
diff changeset
5669 replybuffer send-actions)
34859
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5670 ;; FIXME: Should return nil if failure.
596342378358 * message.el (message-mail): Support yank-action.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34858
diff changeset
5671 t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5672
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5673 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5674 (defun message-news (&optional newsgroups subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5675 "Start editing a news article to be sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5676 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5677 (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
5678 (message-pop-to-buffer (message-buffer-name "posting" nil newsgroups))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5679 (message-setup `((Newsgroups . ,(or newsgroups ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5680 (Subject . ,(or subject ""))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5681
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5682 (defun message-get-reply-headers (wide &optional to-address address-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5683 (let (follow-to mct never-mct to cc author mft recipients)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5684 ;; 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
5685 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5686 (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
5687 ;; 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
5688 ;; 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
5689 (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
5690 (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
5691 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
5692 return t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5693 (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
5694 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
5695 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
5696 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
5697 (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
5698 (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
5699 "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5700 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
5701 (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
5702
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5703 ;; 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
5704 (when mct
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5705 (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
5706 (equal (downcase mct) "nobody"))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5707 (setq never-mct t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5708 (setq mct nil))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5709 ((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
5710 (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
5711 (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
5712
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5713 (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
5714 ;; 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
5715 (cond
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5716 ((not wide)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5717 (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
5718 (address-headers
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5719 (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
5720 (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
5721 (when value
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5722 (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
5723 ((and mft
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5724 (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
5725 (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
5726 (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
5727 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
5728 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
5729
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5730 " mft "
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 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
5733 "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
5734 "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
5735
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5736 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
5737 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
5738 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
5739
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5740 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
5741 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
5742 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
5743 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
5744
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5745 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
5746 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
5747
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
5748 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
5749 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
5750 (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
5751 (to-address
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5752 (setq recipients (concat ", " to-address))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5753 ;; If the author explicitly asked for a copy, we don't deny it to them.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5754 (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
5755 (t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5756 (setq recipients (if never-mct "" (concat ", " author)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5757 (if to (setq recipients (concat recipients ", " to)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5758 (if cc (setq recipients (concat recipients ", " cc)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5759 (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
5760 (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
5761 ;; 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
5762 (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
5763 ;; Squeeze whitespace.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5764 (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
5765 (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
5766 ;; Remove addresses that match `rmail-dont-reply-to-names'.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5767 (let ((rmail-dont-reply-to-names message-dont-reply-to-names))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5768 (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
5769 ;; 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
5770 (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
5771 (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
5772 ;; 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
5773 (setq recipients
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5774 (mapcar
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5775 (lambda (addr)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5776 (cons (downcase (mail-strip-quoted-names addr)) addr))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5777 (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
5778 ;; 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
5779 (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
5780 (while s
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5781 (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
5782
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5783 ;; 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
5784 ;; 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
5785 (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
5786 (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
5787 subaddrs recip)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5788 (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
5789 (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
5790 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
5791 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
5792 (when subaddrs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5793 (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
5794 (while subaddrs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5795 (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
5796 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
5797 (if recip
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5798 (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
5799
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5800 ;; 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
5801 ;; 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
5802 (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
5803 (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
5804 (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
5805 (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
5806 (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
5807 (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
5808 (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
5809 (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
5810 (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
5811 follow-to))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5812
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5813 ;;;###autoload
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5814 (defun message-reply (&optional to-address wide)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5815 "Start editing a reply to the article in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5816 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5817 (require 'gnus-sum) ; for gnus-list-identifiers
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5818 (let ((cur (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5819 from subject date reply-to to cc
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5820 references message-id follow-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5821 (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
5822 (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
5823 gnus-warning)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5824 (save-restriction
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
5825 (message-narrow-to-head-1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5826 ;; Allow customizations to have their say.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5827 (if (not wide)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5828 ;; 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
5829 (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
5830 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5831 (setq follow-to (funcall message-reply-to-function))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5832 ;; 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
5833 (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
5834 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5835 (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
5836 (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
5837 (setq message-id (message-fetch-field "message-id" t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5838 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
5839 date (message-fetch-field "date")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5840 from (message-fetch-field "from")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5841 subject (or (message-fetch-field "subject") "none"))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5842 (when gnus-list-identifiers
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5843 (setq subject (message-strip-list-identifiers subject)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5844 (setq subject (concat "Re: " (message-strip-subject-re subject)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5845 (when 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
5846 (setq subject (message-strip-subject-trailing-was subject)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5847
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5848 (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
5849 (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
5850 (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
5851
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5852 (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
5853 (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
5854
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5855 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5856 (message-pop-to-buffer
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5857 (message-buffer-name
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5858 (if wide "wide reply" "reply") from
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
5859 (if wide to-address nil))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5860
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5861 (setq message-reply-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5862 (vector 0 subject from date message-id references 0 0 ""))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5863
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5864 (message-setup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5865 `((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
5866 ,@follow-to)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5867 cur)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5868
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5869 ;;;###autoload
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5870 (defun message-wide-reply (&optional to-address)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5871 "Make a \"wide\" reply to the message in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5872 (interactive)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
5873 (message-reply to-address t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5874
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5875 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5876 (defun message-followup (&optional to-newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5877 "Follow up to the message in the current buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5878 If TO-NEWSGROUPS, use that as the new Newsgroups line."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5879 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5880 (require 'gnus-sum) ; for gnus-list-identifiers
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5881 (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
5882 from subject date reply-to mrt mct
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5883 references message-id follow-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5884 (inhibit-point-motion-hooks t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5885 (message-this-is-news t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5886 followup-to distribution newsgroups gnus-warning posted-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5887 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5888 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5889 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5890 (if (search-forward "\n\n" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5891 (1- (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5892 (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
5893 (when (functionp message-followup-to-function)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5894 (setq follow-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5895 (funcall message-followup-to-function)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5896 (setq from (message-fetch-field "from")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5897 date (message-fetch-field "date")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5898 subject (or (message-fetch-field "subject") "none")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5899 references (message-fetch-field "references")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5900 message-id (message-fetch-field "message-id" t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5901 followup-to (message-fetch-field "followup-to")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5902 newsgroups (message-fetch-field "newsgroups")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5903 posted-to (message-fetch-field "posted-to")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5904 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
5905 mrt (message-fetch-field "mail-reply-to")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5906 distribution (message-fetch-field "distribution")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5907 mct (message-fetch-field "mail-copies-to"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5908 (when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5909 (string-match "<[^>]+>" gnus-warning))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5910 (setq message-id (match-string 0 gnus-warning)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5911 ;; Remove bogus distribution.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5912 (when (and (stringp distribution)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5913 (let ((case-fold-search t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5914 (string-match "world" distribution)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5915 (setq distribution nil))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5916 (if gnus-list-identifiers
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5917 (setq subject (message-strip-list-identifiers subject)))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5918 (setq subject (concat "Re: " (message-strip-subject-re subject)))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5919 (when 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
5920 (setq subject (message-strip-subject-trailing-was subject)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5921 (widen))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5922
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5923 (message-pop-to-buffer (message-buffer-name "followup" from newsgroups))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5924
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5925 (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
5926 (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
5927
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5928 (message-setup
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5929 `((Subject . ,subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5930 ,@(cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5931 (to-newsgroups
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5932 (list (cons 'Newsgroups to-newsgroups)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5933 (follow-to follow-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5934 ((and followup-to message-use-followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5935 (list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5936 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5937 ((equal (downcase followup-to) "poster")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5938 (if (or (eq message-use-followup-to 'use)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5939 (message-y-or-n-p "Obey Followup-To: poster? " t "\
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5940 You should normally obey the Followup-To: header.
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 `Followup-To: poster' sends your response via e-mail instead of news.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5943
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5944 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
5945 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
5946
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
5947 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
5948 want to get rid of this query permanently."))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5949 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5950 (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
5951 (cons 'To (or mrt reply-to from "")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5952 (cons 'Newsgroups newsgroups)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5953 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5954 (if (or (equal followup-to newsgroups)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5955 (not (eq message-use-followup-to 'ask))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5956 (message-y-or-n-p
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5957 (concat "Obey Followup-To: " followup-to "? ") t "\
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5958 You should normally obey the Followup-To: header.
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 `Followup-To: " followup-to "'
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5961 directs your response to " (if (string-match "," followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5962 "the specified newsgroups"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5963 "that newsgroup only") ".
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5964
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5965 If a message is posted to several newsgroups, Followup-To is often
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5966 used to direct the following discussion to one newsgroup only,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5967 because discussions that are spread over several newsgroup tend to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5968 be fragmented and very difficult to follow.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5969
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5970 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
5971 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
5972
3f394ef46f57 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
5973 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
5974 want to get rid of this query permanently."))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5975 (cons 'Newsgroups followup-to)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5976 (cons 'Newsgroups newsgroups))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5977 (posted-to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5978 `((Newsgroups . ,posted-to)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5979 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5980 `((Newsgroups . ,newsgroups))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5981 ,@(and distribution (list (cons 'Distribution distribution)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5982 ,@(when (and mct
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5983 (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
5984 (equal (downcase mct) "nobody"))))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
5985 (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
5986 (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
5987 (or mrt reply-to from "")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5988 mct)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5989
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5990 cur)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5991
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
5992 (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
5993 "Non-nil means current article is yours.
63398
2f37f6737221 (message-is-yours-p): Fix quoting.
Juanma Barranquero <lekktu@gmail.com>
parents: 62755
diff changeset
5994 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
5995 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
5996 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
5997 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
5998 ;; 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
5999 ;; <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
6000 ;;
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6001 ;; 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
6002 ;; 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
6003 ;; issue cancel
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6004 ;; ELSE
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6005 ;; 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
6006 ;; ELSE
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6007 ;; 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
6008 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6009 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6010 (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
6011 (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
6012 (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
6013 t
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6014 (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
6015 (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
6016 (or
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6017 (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
6018 (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
6019 (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
6020 (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
6021 ;; 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
6022 (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
6023 (string-equal
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6024 (downcase (cadr (mail-extract-address-components from)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6025 (downcase (cadr (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
6026 (message-make-from))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6027 ;; 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
6028 ;; '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
6029 (and from
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6030 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
6031 (string-match
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6032 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
6033 (cadr (mail-extract-address-components from))))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6034
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6035 ;;;###autoload
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6036 (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
6037 "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
6038 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
6039 (interactive "P")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6040 (unless (message-news-p)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6041 (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
6042 (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
6043 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6044 ;; 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
6045 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6046 (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
6047 (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
6048 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
6049 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
6050 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
6051 ;; 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
6052 (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
6053 (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
6054 (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
6055 ;; Make control message.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6056 (if arg
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6057 (message-news)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6058 (setq buf (set-buffer (get-buffer-create " *message cancel*"))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6059 (erase-buffer)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6060 (insert "Newsgroups: " newsgroups "\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6061 "From: " from "\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6062 "Subject: cmsg cancel " message-id "\n"
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6063 "Control: cancel " message-id "\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6064 (if distribution
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6065 (concat "Distribution: " distribution "\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6066 "")
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6067 mail-header-separator "\n"
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6068 message-cancel-message)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6069 (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
6070 (unless arg
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6071 (message "Canceling your article...")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6072 (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
6073 '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
6074 (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
6075 (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
6076 (kill-buffer buf))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6077
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6078 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6079 (defun message-supersede ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6080 "Start composing a message to supersede the current message.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6081 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
6082 header line with the old Message-ID."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6083 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6084 (let ((cur (current-buffer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6085 ;; 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
6086 (unless (message-is-yours-p)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6087 (error "This article is not yours"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6088 ;; Get a normal message buffer.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6089 (message-pop-to-buffer (message-buffer-name "supersede"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6090 (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
6091 (mime-to-mml)
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6092 (message-narrow-to-head-1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6093 ;; Remove unwanted headers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6094 (when message-ignored-supersedes-headers
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6095 (message-remove-header message-ignored-supersedes-headers t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6096 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6097 (if (not (re-search-forward "^Message-ID: " nil t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6098 (error "No Message-ID in this article")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6099 (replace-match "Supersedes: " t t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6100 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6101 (insert mail-header-separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6102 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6103 (forward-line 1)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6104
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6105 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6106 (defun message-recover ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6107 "Reread contents of current buffer from its last auto-save file."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6108 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6109 (let ((file-name (make-auto-save-file-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6110 (cond ((save-window-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6111 (if (not (eq system-type 'vax-vms))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6112 (with-output-to-temp-buffer "*Directory*"
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6113 (with-current-buffer standard-output
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6114 (fundamental-mode)) ; for Emacs 20.4+
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6115 (buffer-disable-undo standard-output)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6116 (let ((default-directory "/"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6117 (call-process
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6118 "ls" nil standard-output nil "-l" file-name))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6119 (yes-or-no-p (format "Recover auto save file %s? " file-name)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6120 (let ((buffer-read-only nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6121 (erase-buffer)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6122 (insert-file-contents file-name nil)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6123 (t (error "message-recover cancelled")))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6124
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6125 ;;; Washing Subject:
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6126
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6127 (defun message-wash-subject (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6128 "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
6129 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
6130 (with-temp-buffer
41494
933ab100fb4a 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36856
diff changeset
6131 (insert subject)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6132 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6133 ;; 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
6134 (while (re-search-forward
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6135 "\\([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
6136 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6137
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6138 ;; 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
6139 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6140 (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
6141 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6142
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6143 ;; and off the end
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6144 (goto-char (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6145 (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
6146 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6147
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6148 ;; 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
6149 (goto-char (point-min))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6150 (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
6151 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6152 (goto-char (point-max))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6153 (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
6154 (replace-match ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6155
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6156 (buffer-string)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6157
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6158 ;;; Forwarding messages.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6159
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6160 (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
6161 "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
6162
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6163 (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
6164 "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
6165 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
6166 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
6167 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
6168 (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
6169 (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
6170 (prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6171 (if group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6172 (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
6173 (or (and from (car (gnus-extract-address-components from)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6174 "(nowhere)"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6175 (concat "["
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6176 (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
6177 prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6178 (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
6179 "] " subject)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6180
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6181 (defun message-forward-subject-author-subject (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6182 "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
6183 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
6184 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
6185 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
6186 (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
6187 (prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6188 (if group
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6189 (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
6190 (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
6191 "(nowhere)"))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6192 (concat "["
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6193 (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
6194 prefix
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6195 (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
6196 "] " subject)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6197
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6198 (defun message-forward-subject-fwd (subject)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6199 "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
6200 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
6201 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
6202 (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
6203 subject
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6204 (concat "Fwd: " subject)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6205
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6206 (defun message-make-forward-subject ()
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6207 "Return a Subject header suitable for the message in the current buffer."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6208 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6209 (save-restriction
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6210 (message-narrow-to-head-1)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6211 (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
6212 (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
6213 (setq subject
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6214 (if subject
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6215 (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
6216 subject
a35d9c07d074 2001-02-07 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 35453
diff changeset
6217 (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
6218 ""))
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6219 (if message-wash-forwarded-subjects
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6220 (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
6221 ;; Make sure funcs is a list.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6222 (and funcs
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6223 (not (listp funcs))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6224 (setq funcs (list funcs)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6225 ;; 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
6226 ;; func to the next one.
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6227 (while funcs
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6228 (when (functionp (car funcs))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6229 (setq subject (funcall (car funcs) subject)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6230 (setq funcs (cdr funcs)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6231 subject))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6232
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6233 (eval-when-compile
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6234 (defvar gnus-article-decoded-p))
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6235
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6236
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6237 ;;;###autoload
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6238 (defun message-forward (&optional news digest)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6239 "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
6240 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
6241 Optional DIGEST will use digest to forward."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6242 (interactive "P")
36856
e11fd97820c0 2001-03-17 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 36036
diff changeset
6243 (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
6244 (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
6245 (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
6246 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
6247 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
6248 (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
6249 (if news
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6250 (message-news nil subject)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6251 (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
6252 (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
6253
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6254 (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
6255 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6256 "\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
6257 (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
6258 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6259 (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
6260 (mm-disable-multibyte)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6261 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6262 (with-current-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
6263 (mm-with-unibyte-current-buffer (buffer-string))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6264 (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
6265 (mime-to-mml)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6266 (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
6267 (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
6268 (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
6269 (buffer-string)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6270 (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
6271 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6272 "\n-------------------- End of forwarded message --------------------\n")
58835
9bdd97960431 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents: 57856
diff changeset
6273 (when message-forward-ignored-headers
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6274 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6275 (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
6276 (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
6277 (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
6278 (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
6279 (message-remove-header message-forward-ignored-headers t)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6280
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6281 (defun message-forward-make-body-mime (forward-buffer)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6282 (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
6283 (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
6284 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6285 (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
6286 (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
6287 (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
6288 (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
6289 (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
6290 (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
6291 (setq e (point))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6292 (insert "<#/part>\n")))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6293
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6294 (defun message-forward-make-body-mml (forward-buffer)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6295 (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
6296 (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
6297 (if (not 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
6298 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6299 (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
6300 (mm-disable-multibyte)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6301 (insert
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6302 (with-current-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
6303 (mm-with-unibyte-current-buffer (buffer-string))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6304 (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
6305 (mime-to-mml)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6306 (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
6307 (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
6308 (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
6309 (buffer-string)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6310 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6311 (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
6312 (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
6313 (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
6314 (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
6315 (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
6316 (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
6317 (setq e (point))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6318 (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
6319 (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
6320 message-forward-ignored-headers)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6321 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6322 (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
6323 (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
6324 (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
6325 (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
6326 (message-remove-header message-forward-ignored-headers t)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6327
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6328 (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
6329 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6330 "\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
6331 (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
6332 (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
6333 (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
6334 (insert
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6335 "\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
6336
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6337 (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
6338 (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
6339 (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
6340 (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
6341 (setq e (point))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6342 (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
6343 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6344 (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
6345 (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
6346 (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
6347 (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
6348 (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
6349
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6350 (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
6351 (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
6352 (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
6353 (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
6354
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6355 ;;;###autoload
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6356 (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
6357 ;; 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
6358 ;; message.
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6359 (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
6360 (message-goto-body)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6361 (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
6362 (if digest
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6363 (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
6364 (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
6365 (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
6366 (not (and (eq 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
6367 (with-current-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
6368 (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
6369 (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
6370 "Content-Type: *multipart/\\(signed\\|encrypted\\)"
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6371 nil t)))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6372 (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
6373 (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
6374 (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
6375 (message-position-point))
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6376
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6377 ;;;###autoload
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6378 (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
6379 (save-window-excursion
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6380 (set-buffer forward-buffer)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6381 ;; Rmail doesn't have rmail-msg-restore-non-pruned-header in Emacs
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6382 ;; 20. FIXIT, or we drop support for rmail in Emacs 20.
43075
e14b8be37d7d * message.el (message-forward-rmail-make-body): Directly use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 42475
diff changeset
6383 (if (rmail-msg-is-pruned)
e14b8be37d7d * message.el (message-forward-rmail-make-body): Directly use
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 42475
diff changeset
6384 (rmail-msg-restore-non-pruned-header)))
41511
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6385 (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
6386
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6387 (eval-when-compile (defvar rmail-enable-mime-composing))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6388
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6389 ;; 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
6390 ;;;###autoload
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6391 (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
6392 "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
6393 (interactive)
19496cafe865 2001-11-25 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 41494
diff changeset
6394 (setq rmail-enable-mime-composing t)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 49034
diff changeset
6395 (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
6396 'message-forward-rmail-make-body))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6397
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6398 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6399 (defun message-resend (address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6400 "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
6401 (interactive
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6402 (list (message-read-from-minibuffer "Resend message to: ")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6403 (message "Resending message to %s..." address)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6404 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6405 (let ((cur (current-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6406 beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6407 ;; 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
6408 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6409 (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
6410 (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
6411 (let ((message-this-is-mail t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6412 message-setup-hook)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6413 (message-setup `((To . ,address))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6414 ;; 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
6415 (message-generate-headers '(From Date To Message-ID))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6416 (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
6417 ;; 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
6418 (message-remove-header message-ignored-mail-headers t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6419 ;; 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
6420 (goto-char (point-min))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6421 (while (re-search-forward "^[A-Za-z]" nil t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6422 (forward-char -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6423 (insert "Resent-"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6424 (widen)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6425 (forward-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6426 (delete-region (point) (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6427 (setq beg (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6428 ;; Insert the message to be resent.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6429 (insert-buffer-substring cur)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6430 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6431 (search-forward "\n\n")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6432 (forward-char -1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6433 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6434 (narrow-to-region beg (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6435 (message-remove-header message-ignored-resent-headers t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6436 (goto-char (point-max)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6437 (insert mail-header-separator)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6438 ;; 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
6439 (while (re-search-backward "^\\(Also-\\)*Resent-" beg t)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6440 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6441 (insert "Also-"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6442 ;; Quote any "From " lines at the beginning.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6443 (goto-char beg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6444 (when (looking-at "From ")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6445 (replace-match "X-From-Line: "))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6446 ;; Send it.
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6447 (let ((message-inhibit-body-encoding t)
61126
c0aa521e0ca7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220
Miles Bader <miles@gnu.org>
parents: 60655
diff changeset
6448 message-required-mail-headers
c0aa521e0ca7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220
Miles Bader <miles@gnu.org>
parents: 60655
diff changeset
6449 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
6450 (message-send-mail))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6451 (kill-buffer (current-buffer)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6452 (message "Resending message to %s...done" address)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6453
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6454 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6455 (defun message-bounce ()
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6456 "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
6457 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
6458 contains some mail you have written which has been bounced back to
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6459 you."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6460 (interactive)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6461 (let ((handles (mm-dissect-buffer t))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6462 boundary)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6463 (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
6464 (if (stringp (car handles))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6465 ;; 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
6466 (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
6467 ;; 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
6468 ;; manually.
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6469 (mm-insert-part handles)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6470 (undo-boundary)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6471 (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
6472 (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
6473 (setq boundary (point))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6474 ;; 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
6475 (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
6476 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6477 (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
6478 (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
6479 (progn
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6480 (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
6481 (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
6482 (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
6483 (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
6484 (point))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6485 (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
6486 (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
6487 (delete-region (match-beginning 0) (match-end 0)))))
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6488 (mm-enable-multibyte)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6489 (save-restriction
34752
f04f551e94ce * message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34485
diff changeset
6490 (message-narrow-to-head-1)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6491 (message-remove-header message-ignored-bounced-headers t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6492 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6493 (insert mail-header-separator))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6494 (message-position-point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6495
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6496 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6497 ;;; Interactive entry points for new message buffers.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6498 ;;;
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6499
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6500 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6501 (defun message-mail-other-window (&optional to subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6502 "Like `message-mail' command, but display mail buffer in another window."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6503 (interactive)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6504 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6505 (let ((pop-up-windows t)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6506 (special-display-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6507 (special-display-regexps nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6508 (same-window-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6509 (same-window-regexps nil))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6510 (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
6511 (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
6512 (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6513 nil nil 'switch-to-buffer-other-window)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6514
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6515 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6516 (defun message-mail-other-frame (&optional to subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6517 "Like `message-mail' command, but display mail buffer in another frame."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6518 (interactive)
34797
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6519 (unless (message-mail-user-agent)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6520 (let ((pop-up-frames t)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6521 (special-display-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6522 (special-display-regexps nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6523 (same-window-buffer-names nil)
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6524 (same-window-regexps nil))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6525 (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
6526 (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
6527 (message-setup `((To . ,(or to "")) (Subject . ,(or subject "")))
b473bc6d9a55 * mml.el (gnus-add-minor-mode): Autoload.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34766
diff changeset
6528 nil nil 'switch-to-buffer-other-frame)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6529
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6530 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6531 (defun message-news-other-window (&optional newsgroups subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6532 "Start editing a news article to be sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6533 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6534 (let ((pop-up-windows t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6535 (special-display-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6536 (special-display-regexps nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6537 (same-window-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6538 (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
6539 (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
6540 (let ((message-this-is-news t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6541 (message-setup `((Newsgroups . ,(or newsgroups ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6542 (Subject . ,(or subject ""))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6543
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6544 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6545 (defun message-news-other-frame (&optional newsgroups subject)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6546 "Start editing a news article to be sent."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6547 (interactive)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6548 (let ((pop-up-frames t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6549 (special-display-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6550 (special-display-regexps nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6551 (same-window-buffer-names nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6552 (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
6553 (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
6554 (let ((message-this-is-news t))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6555 (message-setup `((Newsgroups . ,(or newsgroups ""))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6556 (Subject . ,(or subject ""))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6557
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6558 ;;; underline.el
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6559
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6560 ;; 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
6561
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6562 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6563 (defun bold-region (start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6564 "Bold all nonblank characters in the region.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6565 Works by overstriking characters.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6566 Called from program, takes two arguments START and END
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6567 which specify the range to operate on."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6568 (interactive "r")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6569 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6570 (let ((end1 (make-marker)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6571 (move-marker end1 (max start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6572 (goto-char (min start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6573 (while (< (point) end1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6574 (or (looking-at "[_\^@- ]")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6575 (insert (char-after) "\b"))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6576 (forward-char 1)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6577
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6578 ;;;###autoload
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6579 (defun unbold-region (start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6580 "Remove all boldness (overstruck characters) in the region.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6581 Called from program, takes two arguments START and END
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6582 which specify the range to operate on."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6583 (interactive "r")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6584 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6585 (let ((end1 (make-marker)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6586 (move-marker end1 (max start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6587 (goto-char (min start end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6588 (while (re-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
6589 (if (eq (char-after) (char-after (- (point) 2)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6590 (delete-char -2))))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6591
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6592 (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
6593 "Exchange point and mark, but don't activate region if it was inactive."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6594 (unless (prog1
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6595 (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
6596 (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
6597 (setq mark-active nil)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6598
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6599 (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
6600 (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
6601 (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
6602 (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
6603 (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
6604 (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
6605 (mapcar #'delete-overlay (overlays-in (point-min) (point-max)))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6606
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6607 ;; Support for toolbar
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6608 (eval-when-compile
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6609 (defvar tool-bar-mode))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6610
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6611 ;; 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
6612 ;; 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
6613 ;; 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
6614 (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
6615 "Update message mode toolbar.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6616 Setter function for custom variables."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6617 (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
6618 (when symbol
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6619 ;; When used as ":set" function:
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6620 (set-default symbol value)))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6621
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6622 (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
6623 'message-tool-bar-gnome
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6624 'message-tool-bar-retro)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6625 "Specifies the message mode tool bar.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6626
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6627 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
6628 `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
6629 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
6630
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6631 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
6632 `message-tool-bar-retro'."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6633 :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
6634 :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
6635 (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
6636 (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
6637 (symbol))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6638 :version "22.1" ;; Gnus 5.10.9
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6639 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6640 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6641 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6642
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6643 (defcustom message-tool-bar-gnome
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6644 '((ispell-message "spell" nil
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6645 :visible (or (not (boundp 'flyspell-mode))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6646 (not flyspell-mode)))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6647 (flyspell-buffer "spell" t
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6648 :visible (and (boundp 'flyspell-mode)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6649 flyspell-mode)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6650 :help "Flyspell whole buffer")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6651 (gmm-ignore "separator")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6652 (message-send-and-exit "mail/send")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6653 (message-dont-send "mail/save-draft")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6654 (message-kill-buffer "close") ;; stock_cancel
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6655 (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
6656 (mml-preview "mail/preview" mml-mode-map)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6657 ;; (mml-secure-message-sign-encrypt "lock" mml-mode-map :visible nil)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6658 (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
6659 (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
6660 (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
6661 (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
6662 (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
6663 "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
6664
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6665 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
6666 :type '(repeat gmm-tool-bar-item)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6667 :version "22.1" ;; Gnus 5.10.9
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6668 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6669 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6670 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6671
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6672 (defcustom message-tool-bar-retro
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6673 '(;; Old Emacs 21 icon for consistency.
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6674 (message-send-and-exit "gnus/mail_send")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6675 (message-kill-buffer "close")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6676 (message-dont-send "cancel")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6677 (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
6678 (ispell-message "spell")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6679 (mml-preview "preview" mml-mode-map)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6680 (message-insert-importance-high "gnus/important")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6681 (message-insert-importance-low "gnus/unimportant")
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6682 (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
6683 "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
6684
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6685 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
6686 :type '(repeat gmm-tool-bar-item)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6687 :version "22.1" ;; Gnus 5.10.9
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6688 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6689 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6690 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6691
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6692 (defcustom message-tool-bar-zap-list
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6693 '(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
6694 print-buffer customize help)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6695 "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
6696 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
6697
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6698 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
6699 :type 'gmm-tool-bar-zap-list
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6700 :version "22.1" ;; Gnus 5.10.9
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6701 :initialize 'custom-initialize-default
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6702 :set 'message-tool-bar-update
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6703 :group 'message)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6704
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6705 (defvar image-load-path)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6706
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6707 (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
6708 "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
6709 When FORCE, rebuild the tool bar."
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6710 (when (and (not (featurep 'xemacs))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6711 (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
6712 tool-bar-mode
70051
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6713 (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
6714 (setq message-tool-bar-map
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6715 (let* ((load-path
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6716 (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
6717 "mail/save-draft.xpm"
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6718 nil t))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6719 (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
6720 (when (boundp 'image-load-path)
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6721 image-load-path))))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6722 (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
6723 message-tool-bar-zap-list
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6724 'message-mode-map))))
700b1f9b81e2 [ Merge Gnome tool bars from Gnus trunk ]
Reiner Steib <Reiner.Steib@gmx.de>
parents: 69944
diff changeset
6725 message-tool-bar-map)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6726
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6727 ;;; Group name completion.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6728
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6729 (defcustom message-newgroups-header-regexp
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6730 "^\\(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
6731 "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
6732 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6733 :type 'regexp)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6734
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6735 (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
6736 (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
6737 '("^\\(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
6738 '("^\\(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
6739 . 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
6740 '("^\\(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
6741 . 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
6742 "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
6743 :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
6744 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6745 :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
6746
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6747 (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
6748 "*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
6749 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
6750 :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
6751 :group 'message
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6752 :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
6753 :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
6754 function))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6755
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6756 (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
6757 "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
6758 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
6759 those headers."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6760 (interactive)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6761 (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
6762 (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
6763 (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
6764 (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
6765 (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
6766 (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
6767 (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
6768 (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
6769 'indent-relative))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6770
66573
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
6771 (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
6772 (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
6773 (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
6774 (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
6775 (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
6776 (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
6777 (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
6778 (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
6779 "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
6780 (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
6781
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6782 (defun message-expand-group ()
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6783 "Expand the group name under point."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6784 (let* ((b (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6785 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6786 (narrow-to-region
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6787 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6788 (beginning-of-line)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6789 (skip-chars-forward "^:")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6790 (1+ (point)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6791 (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6792 (skip-chars-backward "^, \t\n") (point))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6793 (completion-ignore-case t)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6794 (string (buffer-substring b (progn (skip-chars-forward "^,\t\n ")
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6795 (point))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6796 (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6797 (completions (all-completions string hashtb))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6798 comp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6799 (delete-region b (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6800 (cond
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6801 ((= (length completions) 1)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6802 (if (string= (car completions) string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6803 (progn
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6804 (insert string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6805 (message "Only matching group"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6806 (insert (car completions))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6807 ((and (setq comp (try-completion string hashtb))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6808 (not (string= comp string)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6809 (insert comp))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6810 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6811 (insert string)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6812 (if (not comp)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6813 (message "No matching groups")
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6814 (save-selected-window
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6815 (pop-to-buffer "*Completions*")
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6816 (buffer-disable-undo)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6817 (let ((buffer-read-only nil))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6818 (erase-buffer)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6819 (let ((standard-output (current-buffer)))
66573
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
6820 (message-display-completion-list (sort completions 'string<)
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
6821 string))
e65b759c6906 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630
Miles Bader <miles@gnu.org>
parents: 66299
diff changeset
6822 (setq buffer-read-only nil)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6823 (goto-char (point-min))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6824 (delete-region (point) (progn (forward-line 3) (point))))))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6825
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6826 (defun 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
6827 (if (fboundp 'bbdb-complete-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6828 (bbdb-complete-name)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6829 (expand-abbrev)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6830
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6831 ;;; Help stuff.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6832
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6833 (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
6834 "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
6835 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
6836 The following arguments may contain lists of values."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6837 (if (and show
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6838 (setq text (message-flatten-list text)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6839 (save-window-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6840 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6841 (with-output-to-temp-buffer " *MESSAGE information message*"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6842 (set-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
6843 (fundamental-mode) ; for Emacs 20.4+
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6844 (mapcar 'princ text)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6845 (goto-char (point-min))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6846 (funcall ask question))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6847 (funcall ask question)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6848
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6849 (defun message-flatten-list (list)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6850 "Return a new, flat list that contains all elements of LIST.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6851
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6852 \(message-flatten-list '(1 (2 3 (4 5 (6))) 7))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6853 => (1 2 3 4 5 6 7)"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6854 (cond ((consp list)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6855 (apply 'append (mapcar 'message-flatten-list list)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6856 (list
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6857 (list list))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6858
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6859 (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
6860 "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
6861 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
6862 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
6863 regexp VARSTR."
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6864 (let ((oldbuf (current-buffer)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6865 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6866 (set-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
6867 (message-clone-locals oldbuf varstr)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6868 (current-buffer))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6869
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6870 (defun message-clone-locals (buffer &optional varstr)
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6871 "Clone the local variables from BUFFER to the current buffer."
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6872 (let ((locals (save-excursion
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6873 (set-buffer buffer)
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6874 (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
6875 (regexp "^gnus\\|^nn\\|^message\\|^sendmail\\|^smtp\\|^user-mail-address"))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6876 (mapcar
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6877 (lambda (local)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6878 (when (and (consp local)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
6879 (car local)
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6880 (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
6881 (or (null varstr)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6882 (string-match varstr (symbol-name (car local)))))
19969
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6883 (ignore-errors
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6884 (set (make-local-variable (car local))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6885 (cdr local)))))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6886 locals)))
5f1ab3dd344d *** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 19762
diff changeset
6887
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6888 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6889 ;;; MIME functions
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6890 ;;;
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6891
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6892 (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
6893
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6894 (defun message-encode-message-body ()
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6895 (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
6896 (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
6897 message-default-charset))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6898 (case-fold-search t)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6899 lines content-type-p)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6900 (message-goto-body)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6901 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6902 (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
6903 (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
6904 (when new
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6905 (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
6906 (insert new)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6907 (goto-char (point-min))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6908 (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
6909 (delete-char 1)
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6910 (search-forward "\n\n")
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6911 (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
6912 (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
6913 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6914 (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
6915 (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
6916 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6917 (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
6918 (when lines
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6919 (insert lines))
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6920 (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
6921 (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
6922 (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
6923 (save-restriction
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6924 (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
6925 (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
6926 (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
6927 ;; 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
6928 ;; 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
6929 ;; 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
6930 ;; 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
6931 ;; 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
6932 (unless content-type-p
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
6933 (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
6934 ;; 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
6935 (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
6936 (forward-line 1)
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6937 (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
6938
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6939 (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
6940 "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
6941 (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
6942 (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
6943 (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
6944 (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
6945 (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
6946 (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
6947 (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
6948 (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
6949
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6950 (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
6951 "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
6952 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
6953 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
6954 (require 'mail-utils)
35147
bb3753ae88ae Doc and message fixes.
Dave Love <fx@gnu.org>
parents: 34859
diff changeset
6955 (let* ((fields '("To" "Cc"))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6956 (emails
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6957 (split-string
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6958 (mail-strip-quoted-names
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6959 (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
6960 "[ \f\t\n\r\v,]+"))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6961 email)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6962 (while emails
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6963 (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
6964 (setq email (car emails)
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6965 emails nil))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6966 (pop emails))
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6967 (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
6968 (message-remove-header "From")
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6969 (goto-char (point-max))
67030
572ca24101c2 message.el: Revert last changes.
Chong Yidong <cyd@stupidchicken.com>
parents: 66966
diff changeset
6970 (insert "From: " email "\n"))))
32967
7625203dacf3 2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents: 32964
diff changeset
6971
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6972 (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
6973 (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
6974
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6975 (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
6976 (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
6977 (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
6978 (if value
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6979 (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
6980 (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
6981 (and value
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6982 (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
6983 value)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6984
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6985 (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
6986 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6987 (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
6988 (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
6989 (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
6990 (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
6991 (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
6992 (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
6993 (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
6994 (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
6995 (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
6996 (concat
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6997 (or to "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
6998 (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
6999 (or cc "")
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7000 (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
7001 (or bcc "")))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7002
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7003 (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
7004 "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
7005 (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
7006 (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
7007 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
7008 (inhibit-point-motion-hooks t)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7009 (after-change-functions nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7010 (when regexps
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7011 (save-excursion
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7012 (save-restriction
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7013 (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
7014 (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
7015 (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
7016 (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
7017 (message-next-header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7018 (let ((begin (point)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7019 (message-next-header)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7020 (add-text-properties
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7021 begin (point)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7022 '(invisible t message-hidden t))))))))))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7023
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7024 (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
7025 (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
7026 (reverse nil))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7027 (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
7028 (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
7029 (pop regexps))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7030 (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
7031 (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
7032 (if reverse
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7033 (not result)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7034 result)))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7035
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7036 (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
7037 (require 'messagexmas)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 54287
diff changeset
7038 (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
7039
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7040 (provide 'message)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23743
diff changeset
7041
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7042 (run-hooks 'message-load-hook)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7043
31716
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7044 ;; Local Variables:
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7045 ;; coding: iso-8859-1
9968f55ad26e Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents: 24357
diff changeset
7046 ;; End:
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7047
59756
b53453586872 (message-beginning-of-line): Change the behavior when
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 58835
diff changeset
7048 ;; arch-tag: 94b32cac-4504-4b6c-8181-030ebf380ee0
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7049 ;;; message.el ends here