annotate lisp/gnus-msg.el @ 25235:98c67187cd6b

(x_set_icon_type): Support setting frame icons.
author Geoff Voelker <voelker@cs.washington.edu>
date Tue, 10 Aug 1999 17:32:59 +0000
parents 8d8bf85d356a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1 ;;; gnus-msg.el --- mail and post interface for Gnus
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6 ;; Keywords: news
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13 ;; any later version.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
23 ;; Boston, MA 02111-1307, USA.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25 ;;; Commentary:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27 ;;; Code:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
28
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
29 (require 'gnus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
30 (require 'gnus-ems)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
31 (require 'message)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
32 (eval-when-compile (require 'cl))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
33
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
34 ;; Added by Sudish Joseph <joseph@cis.ohio-state.edu>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
35 (defvar gnus-post-method nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
36 "*Preferred method for posting USENET news.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
37 If this variable is nil, Gnus will use the current method to decide
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
38 which method to use when posting. If it is non-nil, it will override
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
39 the current method. This method will not be used in mail groups and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
40 the like, only in \"real\" newsgroups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
41
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
42 The value must be a valid method as discussed in the documentation of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
43 `gnus-select-method'. It can also be a list of methods. If that is
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
44 the case, the user will be queried for what select method to use when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
45 posting.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
46
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
47 (defvar gnus-outgoing-message-group nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
48 "*All outgoing messages will be put in this group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
49 If you want to store all your outgoing mail and articles in the group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
50 \"nnml:archive\", you set this variable to that value. This variable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
51 can also be a list of group names.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
52
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
53 If you want to have greater control over what group to put each
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
54 message in, you can set this variable to a function that checks the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
55 current newsgroup name and then returns a suitable group name (or list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
56 of names).")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
57
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
58 (defvar gnus-mailing-list-groups nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
59 "*Regexp matching groups that are really mailing lists.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
60 This is useful when you're reading a mailing list that has been
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
61 gatewayed to a newsgroup, and you want to followup to an article in
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
62 the group.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
63
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
64 (defvar gnus-sent-message-ids-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
65 (nnheader-concat gnus-directory "Sent-Message-IDs")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
66 "File where Gnus saves a cache of sent message ids.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
67
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
68 (defvar gnus-sent-message-ids-length 1000
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
69 "The number of sent Message-IDs to save.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
70
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
71 ;;; Internal variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
72
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
73 (defvar gnus-message-buffer "*Mail Gnus*")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74 (defvar gnus-article-copy nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
75 (defvar gnus-last-posting-server nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
76
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77 (eval-and-compile
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 (autoload 'gnus-uu-post-news "gnus-uu" nil t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
79 (autoload 'news-setup "rnewspost")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
80 (autoload 'news-reply-mode "rnewspost")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
81 (autoload 'rmail-dont-reply-to "mail-utils")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
82 (autoload 'rmail-output "rmailout"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
83
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
86 ;;; Gnus Posting Functions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
87 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
88
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
89 (gnus-define-keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
90 (gnus-summary-send-map "S" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
91 "p" gnus-summary-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
92 "f" gnus-summary-followup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
93 "F" gnus-summary-followup-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
94 "c" gnus-summary-cancel-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
95 "s" gnus-summary-supersede-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
96 "r" gnus-summary-reply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
97 "R" gnus-summary-reply-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
98 "m" gnus-summary-mail-other-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
99 "u" gnus-uu-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
100 "om" gnus-summary-mail-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
101 "op" gnus-summary-post-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
102 "Om" gnus-uu-digest-mail-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
103 "Op" gnus-uu-digest-post-forward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
104
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
105 (gnus-define-keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
106 (gnus-send-bounce-map "D" gnus-summary-send-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
107 "b" gnus-summary-resend-bounced-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
108 ; "c" gnus-summary-send-draft
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
109 "r" gnus-summary-resend-message)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
110
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
111 ;;; Internal functions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
113 (defvar gnus-article-reply nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
114 (defmacro gnus-setup-message (config &rest forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
115 (let ((winconf (make-symbol "winconf"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
116 (buffer (make-symbol "buffer"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
117 (article (make-symbol "article")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
118 `(let ((,winconf (current-window-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
119 (,buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
120 (,article (and gnus-article-reply (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
121 (message-header-setup-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
122 (copy-sequence message-header-setup-hook)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
123 (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
124 (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
125 ,@forms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
126 (gnus-inews-add-send-actions ,winconf ,buffer ,article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
127 (setq gnus-message-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
128 (gnus-configure-windows ,config t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
129
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
130 (defun gnus-inews-add-send-actions (winconf buffer article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
131 (gnus-make-local-hook 'message-sent-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
132 (gnus-add-hook 'message-sent-hook 'gnus-inews-do-gcc nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
133 (setq message-post-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
134 `(lambda (arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
135 (gnus-post-method arg ,gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
136 (setq message-newsreader (setq message-mailer (gnus-extended-version)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
137 (message-add-action
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
138 `(set-window-configuration ,winconf) 'exit 'postpone 'kill)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
139 (message-add-action
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
140 `(when (buffer-name ,buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
141 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
142 (set-buffer ,buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
143 ,(when article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
144 `(gnus-summary-mark-article-as-replied ,article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
145 'send))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
146
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
147 (put 'gnus-setup-message 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
148 (put 'gnus-setup-message 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
149 (put 'gnus-setup-message 'edebug-form-spec '(form body))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
150
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
151 ;;; Post news commands of Gnus group mode and summary mode
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
152
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
153 (defun gnus-group-mail ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
154 "Start composing a mail."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
155 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
156 (gnus-setup-message 'message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
157 (message-mail)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
158
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
159 (defun gnus-group-post-news (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
160 "Start composing a news message.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
161 If ARG, post to the group under point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
162 If ARG is 1, prompt for a group name."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
163 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
164 ;; Bind this variable here to make message mode hooks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
165 ;; work ok.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
166 (let ((gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
167 (if arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
168 (if (= 1 (prefix-numeric-value arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
169 (completing-read "Newsgroup: " gnus-active-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
170 (gnus-read-active-file-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
171 (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
172 "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
173 (gnus-post-news 'post gnus-newsgroup-name)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
174
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
175 (defun gnus-summary-post-news ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
176 "Start composing a news message."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
177 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
178 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
179 (gnus-post-news 'post gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
180
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
181 (defun gnus-summary-followup (yank &optional force-news)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
182 "Compose a followup to an article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
183 If prefix argument YANK is non-nil, original article is yanked automatically."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
184 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
185 (list (and current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
186 (gnus-summary-work-articles 1))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
187 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
188 (when yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
189 (gnus-summary-goto-subject (car yank)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
190 (save-window-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
191 (gnus-summary-select-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
192 (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
193 (gnus-newsgroup-name gnus-newsgroup-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
194 ;; Send a followup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
195 (gnus-post-news nil gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
196 headers gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
197 yank nil force-news)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
198
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
199 (defun gnus-summary-followup-with-original (n &optional force-news)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
200 "Compose a followup to an article and include the original article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
201 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
202 (gnus-summary-followup (gnus-summary-work-articles n) force-news))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
203
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
204 (defun gnus-inews-yank-articles (articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
205 (let (beg article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
206 (while (setq article (pop articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
207 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
208 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
209 (gnus-summary-select-article nil nil nil article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
210 (gnus-summary-remove-process-mark article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
211 (gnus-copy-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
212 (let ((message-reply-buffer gnus-article-copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
213 (message-reply-headers gnus-current-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
214 (message-yank-original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
215 (setq beg (or beg (mark t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
216 (when articles (insert "\n")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
217
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
218 (push-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
219 (goto-char beg)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
220
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
221 (defun gnus-summary-cancel-article (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
222 "Cancel an article you posted."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
223 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
224 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
225 (let ((articles (gnus-summary-work-articles n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
226 (message-post-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
227 `(lambda (arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
228 (gnus-post-method nil ,gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
229 article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
230 (while (setq article (pop articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
231 (when (gnus-summary-select-article t nil nil article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
232 (when (gnus-eval-in-buffer-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
233 gnus-original-article-buffer (message-cancel-news))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
234 (gnus-summary-mark-as-read article gnus-canceled-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
235 (gnus-cache-remove-article 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
236 (gnus-article-hide-headers-if-wanted))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
237 (gnus-summary-remove-process-mark article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
238
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239 (defun gnus-summary-supersede-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240 "Compose an article that will supersede a previous article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
241 This is done simply by taking the old article and adding a Supersedes
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
242 header line with the old Message-ID."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
243 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
244 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
245 (let ((article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
246 (gnus-setup-message 'reply-yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
247 (gnus-summary-select-article t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
248 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
249 (message-supersede)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
250 (push
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
251 `((lambda ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
252 (gnus-cache-possibly-remove-article ,article nil nil nil t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
253 message-send-actions))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
254
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
255
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
256
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
257 (defun gnus-copy-article-buffer (&optional article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
258 ;; make a copy of the article buffer with all text properties removed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
259 ;; this copy is in the buffer gnus-article-copy.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
260 ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
261 ;; this buffer should be passed to all mail/news reply/post routines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
262 (setq gnus-article-copy (get-buffer-create " *gnus article copy*"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
263 (buffer-disable-undo gnus-article-copy)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
264 (or (memq gnus-article-copy gnus-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
265 (setq gnus-buffer-list (cons gnus-article-copy gnus-buffer-list)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
266 (let ((article-buffer (or article-buffer gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
267 end beg contents)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
268 (when (and (get-buffer article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
269 (buffer-name (get-buffer article-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
270 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
271 (set-buffer article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
272 (save-restriction
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
273 (widen)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
274 (setq contents (format "%s" (buffer-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
275 (set-buffer gnus-original-article-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
276 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
277 (while (looking-at message-unix-mail-delimiter)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
278 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
279 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
280 (setq end (or (search-forward "\n\n" nil t) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
281 (set-buffer gnus-article-copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
282 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
283 (insert contents)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
284 (delete-region (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
285 (or (search-forward "\n\n" nil t) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
286 (insert-buffer-substring gnus-original-article-buffer beg end)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
287 gnus-article-copy)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
288
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
289 (defun gnus-post-news (post &optional group header article-buffer yank subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
290 force-news)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
291 (when article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
292 (gnus-copy-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
293 (let ((gnus-article-reply article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
294 (gnus-setup-message (cond (yank 'reply-yank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
295 (article-buffer 'reply)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
296 (t 'message))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
297 (let* ((group (or group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
298 (pgroup group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
299 to-address to-group mailing-list to-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
300 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
301 (setq to-address (gnus-group-get-parameter group 'to-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
302 to-group (gnus-group-get-parameter group 'to-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
303 to-list (gnus-group-get-parameter group 'to-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
304 mailing-list (when gnus-mailing-list-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
305 (string-match gnus-mailing-list-groups group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
306 group (gnus-group-real-name group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
307 (if (or (and to-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
308 (gnus-news-group-p to-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
309 force-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
310 (and (gnus-news-group-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
311 (or pgroup gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
312 (if header (mail-header-number header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
313 gnus-current-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
314 (not mailing-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
315 (not to-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
316 (not to-address)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
317 ;; This is news.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
318 (if post
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
319 (message-news (or to-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
320 (set-buffer gnus-article-copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
321 (message-followup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
322 ;; The is mail.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
323 (if post
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
324 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
325 (message-mail (or to-address to-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
326 ;; Arrange for mail groups that have no `to-address' to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
327 ;; get that when the user sends off the mail.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
328 (push (list 'gnus-inews-add-to-address group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
329 message-send-actions))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
330 (set-buffer gnus-article-copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
331 (message-wide-reply to-address)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
332 (when yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
333 (gnus-inews-yank-articles yank))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
334
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
335 (defun gnus-post-method (arg group &optional silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
336 "Return the posting method based on GROUP and ARG.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
337 If SILENT, don't prompt the user."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
338 (let ((group-method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
339 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
340 ;; If the group-method is nil (which shouldn't happen) we use
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
341 ;; the default method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
342 ((null arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
343 (or gnus-post-method gnus-select-method message-post-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
344 ;; We want this group's method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
345 ((and arg (not (eq arg 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
346 group-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
347 ;; We query the user for a post method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
348 ((or arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
349 (and gnus-post-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
350 (listp (car gnus-post-method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
351 (let* ((methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
352 ;; Collect all methods we know about.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
353 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
354 (when gnus-post-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
355 (if (listp (car gnus-post-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
356 gnus-post-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
357 (list gnus-post-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
358 gnus-secondary-select-methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
359 (list gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
360 (list group-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
361 method-alist post-methods method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
362 ;; Weed out all mail methods.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
363 (while methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
364 (setq method (gnus-server-get-method "" (pop methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
365 (when (or (gnus-method-option-p method 'post)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
366 (gnus-method-option-p method 'post-mail))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
367 (push method post-methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
368 ;; Create a name-method alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
369 (setq method-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
370 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
371 (lambda (m)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
372 (list (concat (cadr m) " (" (symbol-name (car m)) ")") m))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
373 post-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
374 ;; Query the user.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
375 (cadr
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
376 (assoc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
377 (setq gnus-last-posting-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
378 (if (and silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
379 gnus-last-posting-server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
380 ;; Just use the last value.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
381 gnus-last-posting-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
382 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
383 "Posting method: " method-alist nil t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
384 (cons (or gnus-last-posting-server "") 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
385 method-alist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
386 ;; Override normal method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
387 ((and gnus-post-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
388 (or (gnus-method-option-p group-method 'post)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
389 (gnus-method-option-p group-method 'post-mail)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
390 gnus-post-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
391 ;; Perhaps this is a mail group?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
392 ((and (not (gnus-member-of-valid 'post group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
393 (not (gnus-method-option-p group-method 'post-mail)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
394 group-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
395 ;; Use the normal select method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
396 (t gnus-select-method))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
397
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
398 (defun gnus-inews-narrow-to-headers ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
399 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
400 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
401 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
402 (or (and (re-search-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
403 (concat "^" (regexp-quote mail-header-separator) "$") nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
404 (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
405 (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
406 (goto-char (point-min)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
407
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
408 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
409 ;;; Check whether the message has been sent already.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
410 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
411
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
412 (defvar gnus-inews-sent-ids nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
413
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
414 (defun gnus-inews-reject-message ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
415 "Check whether this message has already been sent."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
416 (when gnus-sent-message-ids-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
417 (let ((message-id (save-restriction (gnus-inews-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
418 (mail-fetch-field "message-id")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
419 end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
420 (when message-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
421 (unless gnus-inews-sent-ids
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
422 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
423 (load t t t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
424 (error nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
425 (if (member message-id gnus-inews-sent-ids)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
426 ;; Reject this message.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
427 (not (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
428 (format "Message %s already sent. Send anyway? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
429 message-id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
430 (push message-id gnus-inews-sent-ids)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
431 ;; Chop off the last Message-IDs.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
432 (when (setq end (nthcdr gnus-sent-message-ids-length
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
433 gnus-inews-sent-ids))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
434 (setcdr end nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
435 (nnheader-temp-write gnus-sent-message-ids-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
436 (prin1 `(setq gnus-inews-sent-ids ',gnus-inews-sent-ids)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
437 (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
438 nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
439
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
440
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
441
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
442 ;; Dummy to avoid byte-compile warning.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
443 (defvar nnspool-rejected-article-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
444
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
445 ;;; Since the X-Newsreader/X-Mailer are ``vanity'' headers, they might
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
446 ;;; as well include the Emacs version as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
447 ;;; The following function works with later GNU Emacs, and XEmacs.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
448 (defun gnus-extended-version ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
449 "Stringified Gnus version and Emacs version"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
450 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
451 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
452 gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
453 "/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
454 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
455 ((string-match "^\\([0-9]+\\.[0-9]+\\)\\.[.0-9]+$" emacs-version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
456 (concat "Emacs " (substring emacs-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
457 (match-beginning 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
458 (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
459 ((string-match "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)" emacs-version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
460 (concat (substring emacs-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
461 (match-beginning 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
462 (match-end 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
463 (format " %d.%d" emacs-major-version emacs-minor-version)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
464 (t emacs-version))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
465
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
466 ;; Written by "Mr. Per Persson" <pp@solace.mh.se>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
467 (defun gnus-inews-insert-mime-headers ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
468 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
469 (let ((mail-header-separator
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
470 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
471 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
472 (if (and (search-forward (concat "\n" mail-header-separator "\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
473 nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
474 (not (search-backward "\n\n" nil t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
475 mail-header-separator
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
476 ""))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
477 (or (mail-position-on-field "Mime-Version")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
478 (insert "1.0")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
479 (cond ((save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
480 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
481 (goto-char (point-min))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
482 (re-search-forward "[\200-\377]" nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
483 (or (mail-position-on-field "Content-Type")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
484 (insert "text/plain; charset=ISO-8859-1"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
485 (or (mail-position-on-field "Content-Transfer-Encoding")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
486 (insert "8bit")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
487 (t (or (mail-position-on-field "Content-Type")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
488 (insert "text/plain; charset=US-ASCII"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
489 (or (mail-position-on-field "Content-Transfer-Encoding")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
490 (insert "7bit")))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
491
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
492
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
493 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
494 ;;; Gnus Mail Functions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
495 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
496
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
497 ;;; Mail reply commands of Gnus summary mode
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
498
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
499 (defun gnus-summary-reply (&optional yank)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
500 "Reply mail to news author.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
501 If prefix argument YANK is non-nil, original article is yanked automatically."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
502 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
503 (list (and current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
504 (gnus-summary-work-articles 1))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
505 ;; Bug fix by jbw@bigbird.bu.edu (Joe Wells)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
506 ;; Stripping headers should be specified with mail-yank-ignored-headers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
507 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
508 (when yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
509 (gnus-summary-goto-subject (car yank)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
510 (let ((gnus-article-reply t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
511 (gnus-setup-message (if yank 'reply-yank 'reply)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
512 (gnus-summary-select-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
513 (set-buffer (gnus-copy-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
514 (message-reply nil nil (gnus-group-get-parameter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
515 gnus-newsgroup-name 'broken-reply-to))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
516 (when yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
517 (gnus-inews-yank-articles yank)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
518
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
519 (defun gnus-summary-reply-with-original (n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
520 "Reply mail to news author with original article."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
521 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
522 (gnus-summary-reply (gnus-summary-work-articles n)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
523
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
524 (defun gnus-summary-mail-forward (&optional post)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
525 "Forward the current message to another user."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
526 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
527 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
528 (gnus-setup-message 'forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
529 (gnus-summary-select-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
530 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
531 (message-forward post)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
532
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
533 (defun gnus-summary-resend-message (address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
534 "Resend the current article to ADDRESS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
535 (interactive "sResend message to: ")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
536 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
537 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
538 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
539 (message-resend address)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
540
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
541 (defun gnus-summary-post-forward ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
542 "Forward the current article to a newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
543 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
544 (gnus-summary-mail-forward t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
545
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
546 (defvar gnus-nastygram-message
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
547 "The following article was inappropriately posted to %s.\n"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
548 "Format string to insert in nastygrams.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
549 The current group name will be inserted at \"%s\".")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
550
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551 (defun gnus-summary-mail-nastygram (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
552 "Send a nastygram to the author of the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
553 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
554 (if (or gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
555 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
556 "Really send a nastygram to the author of the current article? "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
557 (let ((group gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
558 (gnus-summary-reply-with-original n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
559 (set-buffer gnus-message-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
560 (insert (format gnus-nastygram-message group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
561 (message-send-and-exit))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
562
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
563 (defun gnus-summary-mail-other-window ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
564 "Compose mail in other window."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
565 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
566 (gnus-setup-message 'message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
567 (message-mail)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
568
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
569 (defun gnus-mail-parse-comma-list ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
570 (let (accumulated
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
571 beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
572 (skip-chars-forward " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
573 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
574 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
575 (skip-chars-forward "^,")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
576 (while (zerop
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
577 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
578 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
579 (let ((i 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
580 (narrow-to-region beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
581 (goto-char beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
582 (logand (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
583 (while (search-forward "\"" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
584 (incf i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
585 (if (zerop i) 2 i)) 2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
586 (skip-chars-forward ",")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
587 (skip-chars-forward "^,"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
588 (skip-chars-backward " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
589 (setq accumulated
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
590 (cons (buffer-substring beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
591 accumulated))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
592 (skip-chars-forward "^,")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
593 (skip-chars-forward ", "))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
594 accumulated))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
595
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
596 (defun gnus-mail-yank-original ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
597 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
598 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
599 (mail-yank-original nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
600 (or mail-yank-hooks mail-citation-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
601 (run-hooks 'news-reply-header-hook)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
602
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
603 (defun gnus-inews-add-to-address (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
604 (let ((to-address (mail-fetch-field "to")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
605 (when (and to-address
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
606 (gnus-alive-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
607 ;; This mail group doesn't have a `to-list', so we add one
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
608 ;; here. Magic!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
609 (gnus-group-add-parameter group (cons 'to-list to-address)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
610
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
611 (defun gnus-put-message ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
612 "Put the current message in some group and return to Gnus."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
613 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
614 (let ((reply gnus-article-reply)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
615 (winconf gnus-prev-winconf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
616 (group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
617
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
618 (or (and group (not (gnus-group-read-only-p group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
619 (setq group (read-string "Put in group: " nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
620 (gnus-writable-groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
621 (and (gnus-gethash group gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
622 (error "No such group: %s" group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
623
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
624 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
625 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
626 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
627 (gnus-inews-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
628 (let (gnus-deletable-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
629 (if (message-news-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
630 (message-generate-headers message-required-news-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
631 (message-generate-headers message-required-mail-headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
632 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
633 (insert "Gcc: " group "\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
634 (widen)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
635
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
636 (gnus-inews-do-gcc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
637
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
638 (if (get-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
640 (if (gnus-buffer-exists-p (car-safe reply))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
641 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642 (set-buffer (car reply))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643 (and (cdr reply)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
644 (gnus-summary-mark-article-as-replied
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
645 (cdr reply)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
646 (and winconf (set-window-configuration winconf))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
647
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
648 (defun gnus-article-mail (yank)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
649 "Send a reply to the address near point.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
650 If YANK is non-nil, include the original article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
651 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
652 (let ((address
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
653 (buffer-substring
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
654 (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
655 (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
656 (when address
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
657 (message-reply address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
658 (when yank
15559
8d8bf85d356a Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
659 (gnus-inews-yank-articles (list (cdr gnus-article-current)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
660
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
661 (defun gnus-bug ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
662 "Send a bug report to the Gnus maintainers."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
663 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
664 (gnus-setup-message 'bug
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
665 (delete-other-windows)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
666 (switch-to-buffer "*Gnus Help Bug*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
667 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
668 (insert gnus-bug-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
669 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
670 (message-pop-to-buffer "*Gnus Bug*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
671 (message-setup `((To . ,gnus-maintainer) (Subject . "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
672 (push `(gnus-bug-kill-buffer) message-send-actions)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
673 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
674 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
675 (forward-line 1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
676 (insert (gnus-version) "\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
677 (insert (emacs-version))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
678 (insert "\n\n\n\n\n")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
679 (gnus-debug)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
680 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
681 (search-forward "Subject: " nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
682 (message "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
683
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
684 (defun gnus-bug-kill-buffer ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
685 (and (get-buffer "*Gnus Help Bug*")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
686 (kill-buffer "*Gnus Help Bug*")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
687
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
688 (defun gnus-debug ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
689 "Attemps to go through the Gnus source file and report what variables have been changed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
690 The source file has to be in the Emacs load path."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
691 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
692 (let ((files '("gnus.el" "gnus-msg.el" "gnus-score.el" "nnmail.el"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
693 "message.el"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
694 file dirs expr olist sym)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
695 (gnus-message 4 "Please wait while we snoop your variables...")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
696 (sit-for 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
697 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
698 (set-buffer (get-buffer-create " *gnus bug info*"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
699 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
700 (while files
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
701 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
702 (setq dirs load-path)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
703 (while dirs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
704 (if (or (not (car dirs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
705 (not (stringp (car dirs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
706 (not (file-exists-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
707 (setq file (concat (file-name-as-directory
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
708 (car dirs)) (car files))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
709 (setq dirs (cdr dirs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
710 (setq dirs nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
711 (insert-file-contents file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
712 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
713 (if (not (re-search-forward "^;;* *Internal variables" nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
714 (gnus-message 4 "Malformed sources in file %s" file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
715 (narrow-to-region (point-min) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
716 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
717 (while (setq expr (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
718 (read (current-buffer)) (error nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
719 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
720 (and (eq (car expr) 'defvar)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
721 (stringp (nth 3 expr))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
722 (or (not (boundp (nth 1 expr)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
723 (not (equal (eval (nth 2 expr))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
724 (symbol-value (nth 1 expr)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
725 (setq olist (cons (nth 1 expr) olist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
726 (error nil))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
727 (setq files (cdr files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
728 (kill-buffer (current-buffer)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
729 (when (setq olist (nreverse olist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
730 (insert "------------------ Environment follows ------------------\n\n"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
731 (while olist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
732 (if (boundp (car olist))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
733 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
734 (pp `(setq ,(car olist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
735 ,(if (or (consp (setq sym (symbol-value (car olist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
736 (and (symbolp sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
737 (not (or (eq sym nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
738 (eq sym t)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
739 (list 'quote (symbol-value (car olist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
740 (symbol-value (car olist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
741 (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
742 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
743 (format "(setq %s 'whatever)\n" (car olist))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
744 (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
745 (setq olist (cdr olist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
746 (insert "\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
747 ;; Remove any null chars - they seem to cause trouble for some
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
748 ;; mailers. (Byte-compiled output from the stuff above.)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
749 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
750 (while (re-search-forward "[\000\200]" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
751 (replace-match "" t t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
752
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
753 ;;; Treatment of rejected articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
754 ;;; Bounced mail.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
755
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
756 (defun gnus-summary-resend-bounced-mail (&optional fetch)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
757 "Re-mail the current message.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
758 This only makes sense if the current message is a bounce message than
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
759 contains some mail you have written which has been bounced back to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
760 you.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
761 If FETCH, try to fetch the article that this is a reply to, if indeed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
762 this is a reply."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
763 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
764 (gnus-summary-select-article t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
765 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
766 (gnus-setup-message 'compose-bounce
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
767 (let* ((references (mail-fetch-field "references"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
768 (parent (and references (gnus-parent-id references))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
769 (message-bounce)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
770 ;; If there are references, we fetch the article we answered to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
771 (and fetch parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
772 (gnus-summary-refer-article parent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
773 (gnus-summary-show-all-headers)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
774
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
775 ;;; Gcc handling.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
776
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
777 ;; Do Gcc handling, which copied the message over to some group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
778 (defun gnus-inews-do-gcc (&optional gcc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
779 (when (gnus-alive-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
780 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
781 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
782 (message-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
783 (let ((gcc (or gcc (mail-fetch-field "gcc" nil t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
784 (cur (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
785 groups group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
786 (when gcc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
787 (message-remove-header "gcc")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
788 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
789 (setq groups (message-tokenize-header gcc " ,"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
790 ;; Copy the article over to some group(s).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
791 (while (setq group (pop groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
792 (gnus-check-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
793 (setq method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
794 (cond ((and (null (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
795 (eq (car gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
796 (car
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
797 (gnus-server-to-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
798 (gnus-group-method group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
799 ;; If the group doesn't exist, we assume
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
800 ;; it's an archive group...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
801 gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
802 ;; Use the method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
803 ((gnus-info-method (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
804 (gnus-info-method (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
805 ;; Find the method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
806 (t (gnus-group-method group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
807 (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
808 (unless (gnus-request-group group t method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
809 (gnus-request-create-group group method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
810 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
811 (nnheader-set-temp-buffer " *acc*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
812 (insert-buffer-substring cur)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
813 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
814 (when (re-search-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
815 (concat "^" (regexp-quote mail-header-separator) "$")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
816 nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
817 (replace-match "" t t ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
818 (unless (gnus-request-accept-article group method t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
819 (gnus-message 1 "Couldn't store article in group %s: %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
820 group (gnus-status-message method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
821 (sit-for 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
822 (kill-buffer (current-buffer))))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
823
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
824 (defun gnus-inews-insert-gcc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
825 "Insert Gcc headers based on `gnus-outgoing-message-group'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
826 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
827 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
828 (gnus-inews-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
829 (let* ((group gnus-outgoing-message-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
830 (gcc (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
831 ((gnus-functionp group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
832 (funcall group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
833 ((or (stringp group) (list group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
834 group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
835 (when gcc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
836 (insert "Gcc: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
837 (if (stringp gcc) gcc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
838 (mapconcat 'identity gcc " "))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
839 "\n"))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
840
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
841 (defun gnus-inews-insert-archive-gcc (&optional group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
842 "Insert the Gcc to say where the article is to be archived."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
843 (let* ((var gnus-message-archive-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
844 (group (or group gnus-newsgroup-name ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
845 result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
846 (groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
847 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
848 ((null gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
849 ;; Ignore.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
850 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
851 ((stringp var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
852 ;; Just a single group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
853 (list var))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
854 ((null var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
855 ;; We don't want this.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
856 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
857 ((and (listp var) (stringp (car var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
858 ;; A list of groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
859 var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
860 ((gnus-functionp var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
861 ;; A function.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
862 (funcall var group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
863 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
864 ;; An alist of regexps/functions/forms.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
865 (while (and var
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
866 (not
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
867 (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
868 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
869 ((stringp (caar var))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
870 ;; Regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
871 (when (string-match (caar var) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
872 (cdar var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
873 ((gnus-functionp (car var))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
874 ;; Function.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
875 (funcall (car var) group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
876 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
877 (eval (car var)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
878 (setq var (cdr var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
879 result)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
880 name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
881 (when groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
882 (when (stringp groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
883 (setq groups (list groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
884 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
885 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
886 (gnus-inews-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
887 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
888 (insert "Gcc: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
889 (while (setq name (pop groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
890 (insert (if (string-match ":" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
891 name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
892 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
893 name gnus-message-archive-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
894 (if groups (insert " ")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
895 (insert "\n"))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
896
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
897 (defun gnus-summary-send-draft ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
898 "Enter a mail/post buffer to edit and send the draft."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
899 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
900 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
901 (let (buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
902 (if (not (setq buf (gnus-request-restore-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
903 (gnus-summary-article-number) gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
904 (error "Couldn't restore the article")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
905 (switch-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
906 (when (eq major-mode 'news-reply-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
907 (local-set-key "\C-c\C-c" 'gnus-inews-news))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
908 ;; Insert the separator.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
909 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
910 (search-forward "\n\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
911 (forward-char -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
912 (insert mail-header-separator)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
913 ;; Configure windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
914 (let ((gnus-draft-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
915 (gnus-configure-windows 'draft t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
916 (goto-char (point))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
917
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
918 (gnus-add-shutdown 'gnus-inews-close 'gnus)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
919
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
920 (defun gnus-inews-close ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
921 (setq gnus-inews-sent-ids nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
922
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
923 ;;; Allow redefinition of functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15298
diff changeset
924
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
925 (gnus-ems-redefine)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
926
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
927 (provide 'gnus-msg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
928
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
929 ;;; gnus-msg.el ends here