1 ;;; gnus-msg.el --- mail and post interface for Semi-gnus
2 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;; Free Software Foundation, Inc.
5 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
6 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
9 ;; Katsumi Yamaoka <yamaoka@jpl.org>
10 ;; Kiyokazu SUTO <suto@merry.xmath.ous.ac.jp>
11 ;; Keywords: mail, news, MIME
13 ;; This file is part of GNU Emacs.
15 ;; GNU Emacs is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 2, or (at your option)
20 ;; GNU Emacs is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;; GNU General Public License for more details.
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA.
34 (eval-when-compile (require 'cl))
35 (eval-when-compile (require 'static))
43 (defcustom gnus-post-method 'current
44 "*Preferred method for posting USENET news.
46 If this variable is `current' (which is the default), Gnus will use
47 the \"current\" select method when posting. If it is `native', Gnus
48 will use the native select method when posting.
50 This method will not be used in mail groups and the like, only in
53 If not `native' nor `current', the value must be a valid method as discussed
54 in the documentation of `gnus-select-method'. It can also be a list of
55 methods. If that is the case, the user will be queried for what select
56 method to use when posting."
57 :group 'gnus-group-foreign
58 :link '(custom-manual "(gnus)Posting Server")
59 :type `(choice (const native)
61 (sexp :tag "Methods" ,gnus-select-method)))
63 (defcustom gnus-outgoing-message-group nil
64 "*All outgoing messages will be put in this group.
65 If you want to store all your outgoing mail and articles in the group
66 \"nnml:archive\", you set this variable to that value. This variable
67 can also be a list of group names.
69 If you want to have greater control over what group to put each
70 message in, you can set this variable to a function that checks the
71 current newsgroup name and then returns a suitable group name (or list
74 :type '(choice (string :tag "Group")
77 (defcustom gnus-mailing-list-groups nil
78 "*If non-nil a regexp matching groups that are really mailing lists.
79 This is useful when you're reading a mailing list that has been
80 gatewayed to a newsgroup, and you want to followup to an article in
83 :type '(choice (regexp)
86 (defcustom gnus-add-to-list nil
87 "*If non-nil, add a `to-list' parameter automatically."
91 (defcustom gnus-crosspost-complaint
94 You posted the article below with the following Newsgroups header:
98 The %s group, at least, was an inappropriate recipient
99 of this message. Please trim your Newsgroups header to exclude this
100 group before posting in the future.
105 "Format string to be inserted when complaining about crossposts.
106 The first %s will be replaced by the Newsgroups header;
107 the second with the current group name."
111 (defcustom gnus-message-setup-hook nil
112 "Hook run after setting up a message buffer."
116 (defcustom gnus-bug-create-help-buffer t
117 "*Should we create the *Gnus Help Bug* buffer?"
121 (defcustom gnus-posting-styles nil
122 "*Alist of styles to use when posting.
123 See Info node `(gnus)Posting Styles'."
125 :link '(custom-manual "(gnus)Posting Styles")
126 :type '(repeat (cons (choice (regexp)
129 (string :tag "Header")
130 (regexp :tag "Regexp"))
134 (choice (const signature)
135 (const signature-file)
143 (string :tag "Header"))
149 (defcustom gnus-named-posting-styles nil
150 "Alist mapping names to the user-defined posting styles."
152 :type '(repeat (cons string
154 (choice (const signature)
155 (const signature-file)
163 (string :tag "Header"))
169 (defcustom gnus-gcc-mark-as-read nil
170 "If non-nil, automatically mark Gcc articles as read."
175 (make-obsolete-variable 'gnus-inews-mark-gcc-as-read
176 'gnus-gcc-mark-as-read)
178 (defcustom gnus-gcc-externalize-attachments nil
179 "Should local-file attachments be included as external parts in Gcc copies?
180 If it is `all', attach files as external parts;
181 if a regexp and matches the Gcc group name, attach files as external parts;
182 if nil, attach files as normal parts."
185 :type '(choice (const nil :tag "None")
186 (const all :tag "Any")
187 (string :tag "Regexp")))
189 (gnus-define-group-parameter
190 posting-charset-alist
193 "Return the permitted unencoded charsets for posting of GROUP."
194 :variable gnus-group-posting-charset-alist
196 '(("^\\(no\\|fr\\)\\.[^,]*\\(,[ \t\n]*\\(no\\|fr\\)\\.[^,]*\\)*$" iso-8859-1 (iso-8859-1))
197 ("^\\(fido7\\|relcom\\)\\.[^,]*\\(,[ \t\n]*\\(fido7\\|relcom\\)\\.[^,]*\\)*$" koi8-r (koi8-r))
198 (message-this-is-mail nil nil)
199 (message-this-is-news nil t))
201 "Alist of regexps and permitted unencoded charsets for posting.
202 Each element of the alist has the form (TEST HEADER BODY-LIST), where
203 TEST is either a regular expression matching the newsgroup header or a
205 HEADER is the charset which may be left unencoded in the header (nil
206 means encode all charsets),
207 BODY-LIST is a list of charsets which may be encoded using 8bit
208 content-transfer encoding in the body, or one of the special values
209 nil (always encode using quoted-printable) or t (always use 8bit).
211 Note that any value other than nil for HEADER infringes some RFCs, so
212 use this option with care."
213 :variable-group gnus-charset
215 '(repeat (list :tag "Permitted unencoded charsets"
217 (regexp :tag "Group")
218 (const :tag "Mail message" :value message-this-is-mail)
219 (const :tag "News article" :value message-this-is-news))
220 (choice :tag "Header"
221 (const :tag "None" nil)
222 (symbol :tag "Charset"))
224 (const :tag "Any" :value t)
225 (const :tag "None" :value nil)
226 (repeat :tag "Charsets"
227 (symbol :tag "Charset")))))
228 :parameter-type '(choice :tag "Permitted unencoded charsets"
231 :parameter-document "\
232 List of charsets that are permitted to be unencoded.")
234 (defcustom gnus-debug-files
235 '("gnus.el" "gnus-sum.el" "gnus-group.el"
236 "gnus-art.el" "gnus-start.el" "gnus-async.el"
237 "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el"
238 "gnus-agent.el" "gnus-cache.el" "gnus-srvr.el"
239 "mm-util.el" "mm-decode.el" "nnmail.el" "nntp.el" "message.el")
240 "Files whose variables will be reported in `gnus-bug'."
243 :type '(repeat (string :tag "File")))
245 (defcustom gnus-debug-exclude-variables
246 '(mm-mime-mule-charset-alist
247 nnmail-split-fancy message-minibuffer-local-map)
248 "Variables that should not be reported in `gnus-bug'."
251 :type '(repeat (symbol :tag "Variable")))
253 (defcustom gnus-discouraged-post-methods
254 '(nndraft nnml nnimap nnmaildir nnmh nnfolder nndir)
255 "A list of back ends that are not used in \"real\" newsgroups.
256 This variable is used only when `gnus-post-method' is `current'."
258 :group 'gnus-group-foreign
259 :type '(repeat (symbol :tag "Back end")))
261 (defcustom gnus-message-replysign
263 "Automatically sign replies to signed messages.
264 See also the `mml-default-sign-method' variable."
268 (defcustom gnus-message-replyencrypt
270 "Automatically encrypt replies to encrypted messages.
271 See also the `mml-default-encrypt-method' variable."
275 (defcustom gnus-message-replysignencrypted
277 "Setting this causes automatically encrypted messages to also be signed."
281 (defcustom gnus-confirm-mail-reply-to-news nil
282 "If non-nil, Gnus requests confirmation when replying to news.
283 This is done because new users often reply by mistake when reading
285 This can also be a function receiving the group name as the only
286 parameter which should return non-nil iff a confirmation is needed, or
287 a regexp, in which case a confirmation is asked for iff the group name
290 :type '(choice (const :tag "No" nil)
292 (regexp :tag "Iff group matches regexp")
293 (function :tag "Iff function evaluates to non-nil")))
295 (defcustom gnus-confirm-treat-mail-like-news
297 "If non-nil, Gnus will treat mail like news with regard to confirmation
298 when replying by mail. See the `gnus-confirm-mail-reply-to-news' variable
299 for fine-tuning this.
300 If nil, Gnus will never ask for confirmation if replying to mail."
304 (defcustom gnus-summary-resend-default-address t
305 "If non-nil, Gnus tries to suggest a default address to resend to.
306 If nil, the address field will always be empty after invoking
307 `gnus-summary-resend-message'."
311 (defcustom gnus-user-agent 'gnus-mime-edit
312 "Which information should be exposed in the User-Agent header.
314 It can be one of the symbols `gnus' \(show only Gnus version\), `emacs-gnus'
315 \(show only Emacs and Gnus versions\), `emacs-gnus-config' \(same as
316 `emacs-gnus' plus system configuration\), `emacs-gnus-type' \(same as
317 `emacs-gnus' plus system type\), `gnus-mime-edit' \(show Gnus version and
318 MIME Edit User-Agent\) or a custom string. If you set it to a string,
319 be sure to use a valid format, see RFC 2616."
322 (item :tag "Show Gnus version and MIME Edit User-Agent"
324 (item :tag "Show Gnus and Emacs versions and system type"
326 (item :tag "Show Gnus and Emacs versions and system configuration"
328 (item :tag "Show Gnus and Emacs versions" emacs-gnus)
329 (item :tag "Show only Gnus version" gnus)
330 (string :tag "Other")))
332 ;;; Internal variables.
334 (defvar gnus-inhibit-posting-styles nil
335 "Inhibit the use of posting styles.")
337 (defvar gnus-article-yanked-articles nil)
338 (defvar gnus-message-buffer "*Mail Gnus*")
339 (defvar gnus-article-copy nil)
340 (defvar gnus-check-before-posting nil)
341 (defvar gnus-last-posting-server nil)
342 (defvar gnus-message-group-art nil)
344 (defvar gnus-msg-force-broken-reply-to nil)
346 (defconst gnus-bug-message
347 (format "Sending a bug report to the Gnus Towers.
348 ========================================
350 This gnus is the %s%s.
351 If you think the bug is a Semi-gnus bug, send a bug report to Semi-gnus
352 Developers. (the addresses below are mailing list addresses)
354 ========================================
356 The buffer below is a mail buffer. When you press `C-c C-c', it will
357 be sent to the Gnus Bug Exterminators.
359 The thing near the bottom of the buffer is how the environment
360 settings will be included in the mail. Please do not delete that.
361 They will tell the Bug People what your environment is, so that it
362 will be easier to locate the bugs.
364 If you have found a bug that makes Emacs go \"beep\", set
365 debug-on-error to t (`M-x set-variable RET debug-on-error RET t RET')
366 and include the backtrace in your bug report.
368 Please describe the bug in annoying, painstaking detail.
370 Thank you for your help in stamping out bugs.
373 (if (string= gnus-product-name "Semi-gnus")
375 ", a modified version of Semi-gnus")))
378 (autoload 'gnus-uu-post-news "gnus-uu" nil t)
379 (autoload 'news-setup "rnewspost")
380 (autoload 'news-reply-mode "rnewspost")
381 (autoload 'rmail-dont-reply-to "mail-utils")
382 (autoload 'rmail-output "rmailout"))
386 ;;; Gnus Posting Functions
389 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map)
390 "p" gnus-summary-post-news
391 "i" gnus-summary-news-other-window
392 "f" gnus-summary-followup
393 "F" gnus-summary-followup-with-original
394 "c" gnus-summary-cancel-article
395 "s" gnus-summary-supersede-article
396 "r" gnus-summary-reply
397 "y" gnus-summary-yank-message
398 "R" gnus-summary-reply-with-original
399 "w" gnus-summary-wide-reply
400 "W" gnus-summary-wide-reply-with-original
401 "v" gnus-summary-very-wide-reply
402 "V" gnus-summary-very-wide-reply-with-original
403 "n" gnus-summary-followup-to-mail
404 "N" gnus-summary-followup-to-mail-with-original
405 "m" gnus-summary-mail-other-window
406 "u" gnus-uu-post-news
407 "\M-c" gnus-summary-mail-crosspost-complaint
408 "Br" gnus-summary-reply-broken-reply-to
409 "BR" gnus-summary-reply-broken-reply-to-with-original
410 "om" gnus-summary-mail-forward
411 "op" gnus-summary-post-forward
412 "Om" gnus-summary-digest-mail-forward
413 "Op" gnus-summary-digest-post-forward
414 "P" gnus-summary-execute-command-with-posting-style)
416 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
417 "b" gnus-summary-resend-bounced-mail
418 ;; "c" gnus-summary-send-draft
419 "r" gnus-summary-resend-message
420 "e" gnus-summary-resend-message-edit)
422 ;;; Internal functions.
424 (defun gnus-inews-make-draft ()
426 (gnus-inews-make-draft-meta-information
427 ,gnus-newsgroup-name ',gnus-article-reply)))
429 (defvar gnus-article-reply nil)
430 (defmacro gnus-setup-message (config &rest forms)
431 (let ((winconf (make-symbol "gnus-setup-message-winconf"))
432 (buffer (make-symbol "gnus-setup-message-buffer"))
433 (article (make-symbol "gnus-setup-message-article"))
434 (yanked (make-symbol "gnus-setup-yanked-articles"))
435 (group (make-symbol "gnus-setup-message-group")))
436 `(let ((,winconf (current-window-configuration))
437 (,buffer (buffer-name (current-buffer)))
438 (,article gnus-article-reply)
439 (,yanked gnus-article-yanked-articles)
440 (,group gnus-newsgroup-name)
441 (message-header-setup-hook
442 (copy-sequence message-header-setup-hook))
443 (message-mode-hook (copy-sequence message-mode-hook))
444 (message-startup-parameter-alist
445 '((reply-buffer . gnus-copy-article-buffer)
446 (original-buffer . gnus-original-article-buffer)
447 (user-agent . Gnus))))
448 (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
449 (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
450 ;; #### FIXME: for a reason that I did not manage to identify yet,
451 ;; the variable `gnus-newsgroup-name' does not honor a dynamically
452 ;; scoped or setq'ed value from a caller like `C-u gnus-summary-mail'.
453 ;; After evaluation of @forms below, it gets the value we actually want
454 ;; to override, and the posting styles are used. For that reason, I've
455 ;; added an optional argument to `gnus-configure-posting-styles' to
456 ;; make sure that the correct value for the group name is used. -- drv
457 (add-hook 'message-mode-hook
459 (gnus-configure-posting-styles ,group)))
460 (gnus-pull ',(intern gnus-draft-meta-information-header)
461 message-required-headers)
463 (not (string= ,group "")))
465 (intern gnus-draft-meta-information-header)
466 (gnus-inews-make-draft))
467 message-required-headers))
471 (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config
473 (setq gnus-message-buffer (current-buffer))
474 (set (make-local-variable 'gnus-message-group-art)
475 (cons ,group ,article))
476 (set (make-local-variable 'gnus-newsgroup-name) ,group)
477 (gnus-maybe-setup-default-charset)
478 (gnus-run-hooks 'gnus-message-setup-hook))
479 (message-hide-headers)
481 (gnus-configure-windows ,config t)
482 (run-hooks 'post-command-hook)
483 (set-buffer-modified-p nil))))
485 (defun gnus-inews-make-draft-meta-information (group article)
486 (concat "(\"" group "\" "
487 (if article (number-to-string
494 (defun gnus-msg-mail (&optional to subject other-headers continue
495 switch-action yank-action send-actions)
496 "Start editing a mail message to be sent.
497 Like `message-mail', but with Gnus paraphernalia, particularly the
498 Gcc: header for archiving purposes."
500 (let ((buf (current-buffer))
502 (gnus-setup-message 'message
503 (message-mail to subject other-headers continue
504 nil yank-action send-actions))
506 (setq mail-buf (current-buffer))
507 (switch-to-buffer buf)
508 (apply switch-action mail-buf nil)))
509 ;; COMPOSEFUNC should return t if succeed. Undocumented ???
512 (defvar save-selected-window-window)
515 (defun gnus-button-mailto (address)
517 (set-buffer (gnus-copy-article-buffer))
518 (gnus-setup-message 'message
519 (message-reply address))
520 (and (boundp 'save-selected-window-window)
521 (not (window-live-p save-selected-window-window))
522 (setq save-selected-window-window (selected-window))))
525 (defun gnus-button-reply (&optional to-address wide)
526 "Like `message-reply'."
528 (gnus-setup-message 'message
529 (message-reply to-address wide))
530 (and (boundp 'save-selected-window-window)
531 (not (window-live-p save-selected-window-window))
532 (setq save-selected-window-window (selected-window))))
535 (define-mail-user-agent 'gnus-user-agent
536 'gnus-msg-mail 'message-send-and-exit
537 'message-kill-buffer 'message-send-hook)
539 (defun gnus-setup-posting-charset (group)
540 (let ((alist gnus-group-posting-charset-alist)
541 (group (or group ""))
545 (while (setq elem (pop alist))
546 (when (or (and (stringp (car elem))
547 (string-match (car elem) group))
548 (and (functionp (car elem))
549 (funcall (car elem) group))
550 (and (symbolp (car elem))
551 (symbol-value (car elem))))
552 (throw 'found (cons (cadr elem) (caddr elem)))))))))
554 (defun gnus-inews-add-send-actions (winconf buffer article
555 &optional config yanked)
556 (gnus-make-local-hook 'message-sent-hook)
557 (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
558 'gnus-inews-do-gcc) nil t)
560 (gnus-make-local-hook 'message-header-hook)
561 (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t))
562 (setq message-post-method
564 (gnus-post-method arg ,gnus-newsgroup-name)))
565 (setq message-user-agent (gnus-message-make-user-agent))
566 (unless message-use-multi-frames
568 `(if (gnus-buffer-exists-p ,buffer)
569 (set-window-configuration ,winconf))
570 'exit 'postpone 'kill))
571 (let ((to-be-marked (cond
573 (article (if (listp article) article (list article)))
576 `(when (gnus-buffer-exists-p ,buffer)
580 (if (eq config 'forward)
581 `(gnus-summary-mark-article-as-forwarded ',to-be-marked)
582 `(gnus-summary-mark-article-as-replied ',to-be-marked)))))
585 (put 'gnus-setup-message 'lisp-indent-function 1)
586 (put 'gnus-setup-message 'edebug-form-spec '(form body))
588 ;;; Post news commands of Gnus group mode and summary mode
590 (defun gnus-group-mail (&optional arg)
591 "Start composing a mail.
592 If ARG, use the group under the point to find a posting style.
593 If ARG is 1, prompt for a group name to find the posting style."
595 ;; We can't `let' gnus-newsgroup-name here, since that leads
596 ;; to local variables leaking.
597 (let ((group gnus-newsgroup-name)
598 ;; make sure last viewed article doesn't affect posting styles:
600 (buffer (current-buffer)))
603 (setq gnus-newsgroup-name
605 (if (= 1 (prefix-numeric-value arg))
606 (completing-read "Use posting style of group: "
607 gnus-active-hashtb nil
608 (gnus-read-active-file-p))
609 (gnus-group-group-name))
611 ;; #### see comment in gnus-setup-message -- drv
612 (gnus-setup-message 'message (message-mail)))
615 (setq gnus-newsgroup-name group)))))
617 (defun gnus-group-news (&optional arg)
618 "Start composing a news.
619 If ARG, post to group under point.
620 If ARG is 1, prompt for group name to post to.
622 This function prepares a news even when using mail groups. This is useful
623 for posting messages to mail groups without actually sending them over the
624 network. The corresponding back end must have a 'request-post method."
626 ;; We can't `let' gnus-newsgroup-name here, since that leads
627 ;; to local variables leaking.
628 (let ((group gnus-newsgroup-name)
629 ;; make sure last viewed article doesn't affect posting styles:
631 (buffer (current-buffer)))
634 (setq gnus-newsgroup-name
636 (if (= 1 (prefix-numeric-value arg))
637 (completing-read "Use group: "
638 gnus-active-hashtb nil
639 (gnus-read-active-file-p))
640 (gnus-group-group-name))
642 ;; #### see comment in gnus-setup-message -- drv
643 (gnus-setup-message 'message
644 (message-news (gnus-group-real-name gnus-newsgroup-name))))
647 (setq gnus-newsgroup-name group)))))
649 (defun gnus-group-post-news (&optional arg)
650 "Start composing a message (a news by default).
651 If ARG, post to group under point. If ARG is 1, prompt for group name.
652 Depending on the selected group, the message might be either a mail or
655 ;; Bind this variable here to make message mode hooks work ok.
656 (let ((gnus-newsgroup-name
658 (if (= 1 (prefix-numeric-value arg))
659 (completing-read "Newsgroup: " gnus-active-hashtb nil
660 (gnus-read-active-file-p))
661 (gnus-group-group-name))
663 ;; make sure last viewed article doesn't affect posting styles:
665 (gnus-post-news 'post gnus-newsgroup-name nil nil nil nil
666 (string= gnus-newsgroup-name ""))))
668 (defun gnus-summary-mail-other-window (&optional arg)
669 "Start composing a mail in another window.
670 Use the posting of the current group by default.
671 If ARG, don't do that. If ARG is 1, prompt for group name to find the
674 ;; We can't `let' gnus-newsgroup-name here, since that leads
675 ;; to local variables leaking.
676 (let ((group gnus-newsgroup-name)
677 ;; make sure last viewed article doesn't affect posting styles:
679 (buffer (current-buffer)))
682 (setq gnus-newsgroup-name
684 (if (= 1 (prefix-numeric-value arg))
685 (completing-read "Use group: "
686 gnus-active-hashtb nil
687 (gnus-read-active-file-p))
689 gnus-newsgroup-name))
690 ;; #### see comment in gnus-setup-message -- drv
691 (gnus-setup-message 'message (message-mail)))
694 (setq gnus-newsgroup-name group)))))
696 (defun gnus-summary-news-other-window (&optional arg)
697 "Start composing a news in another window.
698 Post to the current group by default.
699 If ARG, don't do that. If ARG is 1, prompt for group name to post to.
701 This function prepares a news even when using mail groups. This is useful
702 for posting messages to mail groups without actually sending them over the
703 network. The corresponding back end must have a 'request-post method."
705 ;; We can't `let' gnus-newsgroup-name here, since that leads
706 ;; to local variables leaking.
707 (let ((group gnus-newsgroup-name)
708 ;; make sure last viewed article doesn't affect posting styles:
710 (buffer (current-buffer)))
713 (setq gnus-newsgroup-name
715 (if (= 1 (prefix-numeric-value arg))
716 (completing-read "Use group: "
717 gnus-active-hashtb nil
718 (gnus-read-active-file-p))
720 gnus-newsgroup-name))
721 ;; #### see comment in gnus-setup-message -- drv
722 (gnus-setup-message 'message
724 (message-news (gnus-group-real-name gnus-newsgroup-name))
725 (set (make-local-variable 'gnus-discouraged-post-methods)
727 (car (gnus-find-method-for-group gnus-newsgroup-name))
728 (copy-sequence gnus-discouraged-post-methods))))))
731 (setq gnus-newsgroup-name group)))))
733 (defun gnus-summary-post-news (&optional arg)
734 "Start composing a message. Post to the current group by default.
735 If ARG, don't do that. If ARG is 1, prompt for a group name to post to.
736 Depending on the selected group, the message might be either a mail or
739 ;; Bind this variable here to make message mode hooks work ok.
740 (let ((gnus-newsgroup-name
742 (if (= 1 (prefix-numeric-value arg))
743 (completing-read "Newsgroup: " gnus-active-hashtb nil
744 (gnus-read-active-file-p))
746 gnus-newsgroup-name))
747 ;; make sure last viewed article doesn't affect posting styles:
749 (gnus-post-news 'post gnus-newsgroup-name)))
752 (defun gnus-summary-followup (yank &optional force-news)
753 "Compose a followup to an article.
754 If prefix argument YANK is non-nil, the original article is yanked
756 YANK is a list of elements, where the car of each element is the
757 article number, and the two following numbers is the region to be
760 (list (and current-prefix-arg
761 (gnus-summary-work-articles 1))))
763 (gnus-summary-goto-subject
764 (if (listp (car yank))
767 (save-window-excursion
768 (gnus-summary-select-article))
769 (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
770 (gnus-newsgroup-name gnus-newsgroup-name))
772 (gnus-post-news nil gnus-newsgroup-name
773 headers gnus-article-buffer
775 (gnus-summary-handle-replysign)))
777 (defun gnus-summary-followup-with-original (n &optional force-news)
778 "Compose a followup to an article and include the original article."
780 (gnus-summary-followup (gnus-summary-work-articles n) force-news))
782 (defun gnus-summary-followup-to-mail (&optional arg)
783 "Followup to the current mail message via news."
785 (list (and current-prefix-arg
786 (gnus-summary-work-articles 1))))
787 (gnus-summary-followup arg t))
789 (defun gnus-summary-followup-to-mail-with-original (&optional arg)
790 "Followup to the current mail message via news."
792 (gnus-summary-followup (gnus-summary-work-articles arg) t))
794 (defun gnus-inews-yank-articles (articles)
795 (let (beg article yank-string
796 (more-than-one (cdr articles))
797 (cur (current-buffer))
800 (while (setq article (pop articles))
801 (when (listp article)
802 (setq yank-string (nth 1 article)
803 article (nth 0 article)))
804 (save-window-excursion
805 (set-buffer gnus-summary-buffer)
806 (gnus-summary-select-article nil nil nil article)
807 (gnus-summary-remove-process-mark article))
809 ;; Gathering references.
811 (setq refs (message-list-references
813 (mail-header-references gnus-current-headers)
814 (mail-header-message-id gnus-current-headers)))
815 (when message-use-multi-frames
816 (when (setq window (get-buffer-window cur t))
817 (select-frame (window-frame window)))))
819 (gnus-copy-article-buffer nil yank-string)
820 (let ((message-reply-buffer gnus-article-copy)
821 (message-reply-headers
822 ;; The headers are decoded.
823 (with-current-buffer gnus-article-copy
825 (nnheader-narrow-to-headers)
826 (nnheader-parse-naked-head)))))
827 (message-yank-original)
828 (setq beg (or beg (mark t))))
833 ;; Replace with the gathered references.
837 (message-narrow-to-headers)
838 (let ((case-fold-search t))
839 (if (re-search-forward "^References:\\([\t ]+.+\n\\)+" nil t)
841 (goto-char (point-max))))
843 (list (or (assq 'References message-header-format-alist)
844 '(References . message-shorten-references)))
845 (list (cons 'References
846 (mapconcat 'identity (nreverse refs) " "))))
847 (backward-delete-char 1))
853 (defun gnus-summary-cancel-article (&optional n symp)
854 "Cancel an article you posted.
855 Uses the process-prefix convention. If given the symbolic
856 prefix `a', cancel using the standard posting method; if not
857 post using the current select method."
858 (interactive (gnus-interactive "P\ny"))
859 (let ((articles (gnus-summary-work-articles n))
862 (gnus-post-method (eq ',symp 'a) ,gnus-newsgroup-name)))
864 (while (setq article (pop articles))
865 (when (gnus-summary-select-article t nil nil article)
866 (when (gnus-eval-in-buffer-window gnus-article-buffer
868 (set-buffer gnus-original-article-buffer)
869 (message-cancel-news)))
870 (gnus-summary-mark-as-read article gnus-canceled-mark)
871 (gnus-cache-remove-article 1))
872 (gnus-article-hide-headers-if-wanted))
873 (gnus-summary-remove-process-mark article))))
875 (defun gnus-summary-supersede-article ()
876 "Compose an article that will supersede a previous article.
877 This is done simply by taking the old article and adding a Supersedes
878 header line with the old Message-ID."
880 (let ((article (gnus-summary-article-number)))
881 (gnus-setup-message 'reply-yank
882 (gnus-summary-select-article t)
883 (set-buffer gnus-original-article-buffer)
887 (when (gnus-buffer-exists-p ,gnus-summary-buffer)
889 (set-buffer ,gnus-summary-buffer)
890 (gnus-cache-possibly-remove-article ,article nil nil nil t)
891 (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
892 message-send-actions))))
896 (defun gnus-copy-article-buffer (&optional article-buffer yank-string)
897 ;; make a copy of the article buffer with all text properties removed
898 ;; this copy is in the buffer gnus-article-copy.
899 ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
900 ;; this buffer should be passed to all mail/news reply/post routines.
901 (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*"))
903 (set-buffer gnus-article-copy)
904 (set-buffer-multibyte t))
905 (let ((article-buffer (or article-buffer gnus-article-buffer))
907 (if (not (and (get-buffer article-buffer)
908 (gnus-buffer-exists-p article-buffer)))
909 (error "Can't find any article buffer")
911 (set-buffer article-buffer)
912 (let ((gnus-newsgroup-charset (or gnus-article-charset
913 gnus-newsgroup-charset))
914 (gnus-newsgroup-ignored-charsets
915 (or gnus-article-ignored-charsets
916 gnus-newsgroup-ignored-charsets)))
918 ;; Copy over the (displayed) article buffer, delete
919 ;; hidden text and remove text properties.
921 (copy-to-buffer gnus-article-copy (point-min) (point-max))
922 (set-buffer gnus-article-copy)
923 ;; There's invisible and intangible text in T-gnus. Especially,
924 ;; if there is a boundary line (X-Boundary: ------------------),
925 ;; in the end of a header, it will cause a serious problem.
926 (add-text-properties (point-min) (point-max)
927 '(invisible nil intangible nil))
930 (delete-region (point) (point-max))
931 (insert yank-string))
932 ;; Encode bitmap smileys to ordinary text.
933 ;; Possibly, the original text might be restored.
934 (static-unless (featurep 'xemacs)
935 (when (featurep 'smiley-mule)
936 (smiley-encode-buffer)))
937 (gnus-article-delete-text-of-type 'annotation)
938 (gnus-remove-text-with-property 'gnus-prev)
939 (gnus-remove-text-with-property 'gnus-next)
940 (gnus-remove-text-with-property 'gnus-decoration)
941 (gnus-remove-text-with-property 'x-face-mule-bitmap-image)
944 (static-if (featurep 'xemacs)
945 ;; Revome smiley extents for (possibly) XEmacs 21.1.
947 (buffer-substring-no-properties (point-min)
949 (buffer-substring-no-properties (point-min) (point-max)))
951 ;; Find the original headers.
952 (set-buffer gnus-original-article-buffer)
953 (goto-char (point-min))
954 (while (looking-at message-unix-mail-delimiter)
956 (let ((mail-header-separator ""))
958 end (or (message-goto-body)
959 ;; There may be just a header.
961 ;; Delete the headers from the displayed articles.
962 (set-buffer gnus-article-copy)
963 (let ((mail-header-separator ""))
964 (delete-region (goto-char (point-min))
965 (or (message-goto-body) (point-max))))
966 ;; Insert the original article headers.
967 (insert-buffer-substring gnus-original-article-buffer beg end)
969 (let ((gnus-article-decode-hook
970 (delq 'article-decode-charset
971 (copy-sequence gnus-article-decode-hook))))
972 ;; Needed for T-gnus.
973 (add-hook 'gnus-article-decode-hook
974 'article-decode-encoded-words)
975 (run-hooks 'gnus-article-decode-hook)))))
978 (defun gnus-post-news (post &optional group header article-buffer yank subject
981 (gnus-copy-article-buffer))
982 (let ((gnus-article-reply (and article-buffer (gnus-summary-article-number)))
983 (gnus-article-yanked-articles yank)
984 (add-to-list gnus-add-to-list))
985 (gnus-setup-message (cond (yank 'reply-yank)
986 (article-buffer 'reply)
988 (let* ((group (or group gnus-newsgroup-name))
989 (charset (gnus-group-name-charset nil group))
991 to-address to-group mailing-list to-list
994 (setq to-address (gnus-parameter-to-address group)
995 to-group (gnus-group-find-parameter group 'to-group)
996 to-list (gnus-parameter-to-list group)
997 newsgroup-p (gnus-group-find-parameter group 'newsgroup)
998 mailing-list (when gnus-mailing-list-groups
999 (string-match gnus-mailing-list-groups group))
1000 group (gnus-group-name-decode (gnus-group-real-name group)
1002 (if (or (and to-group
1003 (gnus-news-group-p to-group))
1006 (and (gnus-news-group-p
1007 (or pgroup gnus-newsgroup-name)
1008 (or header gnus-current-article))
1014 (message-news (or to-group group))
1015 (set-buffer gnus-article-copy)
1016 (gnus-msg-treat-broken-reply-to)
1017 (message-followup (if (or newsgroup-p force-news)
1018 (if (save-restriction
1019 (article-narrow-to-head)
1020 (message-fetch-field "newsgroups"))
1027 (message-mail (or to-address to-list))
1028 ;; Arrange for mail groups that have no `to-address' to
1029 ;; get that when the user sends off the mail.
1030 (when (and (not to-list)
1033 (push (list 'gnus-inews-add-to-address pgroup)
1034 message-send-actions)))
1035 (set-buffer gnus-article-copy)
1036 (gnus-msg-treat-broken-reply-to)
1037 (message-wide-reply to-address)))
1039 (gnus-inews-yank-articles yank))))))
1041 (defun gnus-msg-treat-broken-reply-to (&optional force)
1042 "Remove the Reply-to header if broken-reply-to."
1044 (gnus-group-find-parameter
1045 gnus-newsgroup-name 'broken-reply-to))
1047 (message-narrow-to-head)
1048 (message-remove-header "reply-to"))))
1050 (defun gnus-post-method (arg group &optional silent)
1051 "Return the posting method based on GROUP and ARG.
1052 If SILENT, don't prompt the user."
1053 (let ((gnus-post-method (or (gnus-parameter-post-method group)
1055 (group-method (gnus-find-method-for-group group)))
1057 ;; If the group-method is nil (which shouldn't happen) we use
1058 ;; the default method.
1059 ((null group-method)
1060 (or (and (listp gnus-post-method) ;If not current/native/nil
1061 (not (listp (car gnus-post-method))) ; and not a list of methods
1062 gnus-post-method) ;then use it.
1064 message-post-method))
1065 ;; We want the inverse of the default
1066 ((and arg (not (eq arg 0)))
1067 (if (eq gnus-post-method 'current)
1070 ;; We query the user for a post method.
1072 (and (listp gnus-post-method)
1073 (listp (car gnus-post-method))))
1075 ;; Collect all methods we know about.
1077 (when (listp gnus-post-method)
1078 (if (listp (car gnus-post-method))
1080 (list gnus-post-method)))
1081 gnus-secondary-select-methods
1082 (mapcar 'cdr gnus-server-alist)
1083 (mapcar 'car gnus-opened-servers)
1084 (list gnus-select-method)
1085 (list group-method)))
1086 method-alist post-methods method)
1087 ;; Weed out all mail methods.
1089 (setq method (gnus-server-get-method "" (pop methods)))
1090 (when (and (or (gnus-method-option-p method 'post)
1091 (gnus-method-option-p method 'post-mail))
1092 (not (member method post-methods)))
1093 (push method post-methods)))
1094 ;; Create a name-method alist.
1098 (if (equal (cadr m) "")
1099 (list (symbol-name (car m)) m)
1100 (list (concat (cadr m) " (" (symbol-name (car m)) ")") m)))
1105 (setq gnus-last-posting-server
1107 gnus-last-posting-server)
1108 ;; Just use the last value.
1109 gnus-last-posting-server
1111 "Posting method: " method-alist nil t
1112 (cons (or gnus-last-posting-server "") 0))))
1114 ;; Override normal method.
1115 ((and (eq gnus-post-method 'current)
1116 (not (memq (car group-method) gnus-discouraged-post-methods))
1117 (gnus-get-function group-method 'request-post t))
1120 ;; Use gnus-post-method.
1121 ((listp gnus-post-method) ;A method...
1122 (assert (not (listp (car gnus-post-method)))) ;... not a list of methods.
1124 ;; Use the normal select method (nil or native).
1125 (t gnus-select-method))))
1128 ;; Dummies to avoid byte-compile warning.
1130 (defvar xemacs-codename))
1132 (defun gnus-message-make-user-agent (&optional include-mime-info max-column
1134 "Return a user-agent info. If INCLUDE-MIME-INFO is non-nil and the
1135 variable `mime-edit-user-agent-value' is bound, the value will be
1136 included in the return value, and `gnus-user-agent' is ignored. If
1137 MAX-COLUMN is specified, the return value will be folded up as it were
1138 filled. NEWLINE-PRODUCT specifies whether a newline should be
1139 inserted in front of each product-token. If the value is t or `hard',
1140 it works strictly. Otherwise, if it is non-nil (e.g. `soft'), it
1141 works semi-strictly.
1143 Here is an odd example, which inserts a User-Agent: header when you
1144 begin to compose a message:
1146 \(add-hook 'gnus-message-setup-hook
1148 (setq message-user-agent nil)
1151 (message-narrow-to-headers)
1152 (goto-char (point-max))
1153 (insert \"User-Agent: \"
1154 (gnus-message-make-user-agent t 76 'soft)
1157 (let ((gnus-v (gnus-extended-version))
1159 (cond ((and include-mime-info
1160 (boundp 'mime-edit-user-agent-value))
1161 (setq user-agent (concat gnus-v " " mime-edit-user-agent-value)))
1162 ((eq gnus-user-agent 'gnus-mime-edit)
1164 (if (boundp 'mime-edit-user-agent-value)
1165 (concat gnus-v " " mime-edit-user-agent-value)
1170 ((eq gnus-user-agent 'emacs-gnus-config)
1171 system-configuration)
1172 ((eq gnus-user-agent 'emacs-gnus-type)
1173 (symbol-name system-type))
1177 ((eq gnus-user-agent 'gnus)
1179 ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$"
1181 (concat (format (if (boundp 'MULE)
1182 "Mule/2.3 (based on Emacs %s)"
1184 (match-string 1 emacs-version))
1186 (concat " (" system-v ")")
1189 "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?"
1192 (match-string 1 emacs-version)
1193 (format "/%d.%d" emacs-major-version emacs-minor-version)
1194 (if (match-beginning 3)
1195 (match-string 3 emacs-version)
1197 (if (boundp 'xemacs-codename)
1199 " (" xemacs-codename
1201 (concat ", " system-v ")")
1204 (t emacs-version))))
1205 (setq user-agent (if (stringp gnus-user-agent)
1209 (concat " " emacs-v))))))))
1211 (unless (natnump max-column)
1212 (setq max-column 76))
1214 (set-buffer-multibyte t)
1215 (insert (mapconcat 'identity (split-string user-agent) " "))
1216 (goto-char (point-min))
1218 start agent agents width element swidth)
1219 (while (re-search-forward "\\([^ ]+\\) ?" nil t)
1220 (setq start (match-beginning 0))
1221 (if (eq (char-after start) ?\()
1225 (push (buffer-substring start (point)) agent))
1227 (push (nreverse agent) agents))
1228 (setq agent (list (match-string 1)))))
1230 (push (nreverse agent) agents))
1231 (setq agents (nreverse agents))
1232 (if (> (+ 12 (string-width (caar agents))) max-column)
1233 (setq user-agent "\n"
1238 (setq agent (car agents)
1239 agents (cdr agents))
1240 (when (and (not bol)
1241 (or (memq newline-product '(t hard))
1242 (and newline-product
1244 (string-width (mapconcat 'identity
1247 (setq user-agent (concat user-agent "\n")
1251 (setq element (car agent)
1252 swidth (string-width element)
1255 (setq user-agent (if (member user-agent '("" "\n"))
1256 (concat user-agent element)
1257 (concat user-agent " " element))
1258 width (+ width 1 swidth)
1260 (if (> (+ width 1 swidth) max-column)
1261 (setq user-agent (concat user-agent "\n " element)
1263 (setq user-agent (concat user-agent " " element)
1264 width (+ width 1 swidth)))))))))
1269 ;;; Gnus Mail Functions
1272 ;;; Mail reply commands of Gnus summary mode
1274 (defun gnus-summary-reply (&optional yank wide very-wide)
1275 "Start composing a mail reply to the current message.
1276 If prefix argument YANK is non-nil, the original article is yanked
1278 If WIDE, make a wide reply.
1279 If VERY-WIDE, make a very wide reply."
1281 (list (and current-prefix-arg
1282 (gnus-summary-work-articles 1))))
1283 ;; Allow user to require confirmation before replying by mail to the
1284 ;; author of a news article (or mail message).
1286 (not (or (gnus-news-group-p gnus-newsgroup-name)
1287 gnus-confirm-treat-mail-like-news))
1288 (not (cond ((stringp gnus-confirm-mail-reply-to-news)
1289 (string-match gnus-confirm-mail-reply-to-news
1290 gnus-newsgroup-name))
1291 ((functionp gnus-confirm-mail-reply-to-news)
1292 (funcall gnus-confirm-mail-reply-to-news gnus-newsgroup-name))
1293 (t gnus-confirm-mail-reply-to-news)))
1294 (y-or-n-p "Really reply by mail to article author? "))
1296 (if (listp (car yank))
1299 (gnus-article-reply (or article (gnus-summary-article-number)))
1300 (gnus-article-yanked-articles yank)
1302 ;; Stripping headers should be specified with mail-yank-ignored-headers.
1304 (gnus-summary-goto-subject article))
1305 (gnus-setup-message (if yank 'reply-yank 'reply)
1307 (gnus-summary-select-article)
1308 (dolist (article very-wide)
1309 (gnus-summary-select-article nil nil nil article)
1311 (set-buffer (gnus-copy-article-buffer))
1312 (gnus-msg-treat-broken-reply-to)
1314 (message-narrow-to-head)
1315 (setq headers (concat headers (buffer-string)))))))
1316 (set-buffer (gnus-copy-article-buffer))
1317 (gnus-msg-treat-broken-reply-to gnus-msg-force-broken-reply-to)
1319 (message-narrow-to-head)
1323 (goto-char (point-max)))
1324 (message-reply nil wide)
1326 (gnus-inews-yank-articles yank))
1327 (gnus-summary-handle-replysign)))))
1329 (defun gnus-summary-handle-replysign ()
1330 "Check the various replysign variables and take action accordingly."
1331 (when nil;;(or gnus-message-replysign gnus-message-replyencrypt)
1332 (let (signed encrypted)
1334 (set-buffer gnus-article-buffer)
1335 (setq signed (memq 'signed gnus-article-wash-types))
1336 (setq encrypted (memq 'encrypted gnus-article-wash-types)))
1337 (cond ((and gnus-message-replyencrypt encrypted)
1338 (mml-secure-message mml-default-encrypt-method
1339 (if gnus-message-replysignencrypted
1342 ((and gnus-message-replysign signed)
1343 (mml-secure-message mml-default-sign-method 'sign))))))
1345 (defun gnus-summary-reply-with-original (n &optional wide)
1346 "Start composing a reply mail to the current message.
1347 The original article will be yanked."
1349 (gnus-summary-reply (gnus-summary-work-articles n) wide))
1351 (defun gnus-summary-reply-broken-reply-to (&optional yank wide very-wide)
1352 "Like `gnus-summary-reply' except removing reply-to field.
1353 If prefix argument YANK is non-nil, the original article is yanked
1355 If WIDE, make a wide reply.
1356 If VERY-WIDE, make a very wide reply."
1358 (list (and current-prefix-arg
1359 (gnus-summary-work-articles 1))))
1360 (let ((gnus-msg-force-broken-reply-to t))
1361 (gnus-summary-reply yank wide very-wide)))
1363 (defun gnus-summary-reply-broken-reply-to-with-original (n &optional wide)
1364 "Like `gnus-summary-reply-with-original' except removing reply-to field.
1365 The original article will be yanked."
1367 (gnus-summary-reply-broken-reply-to (gnus-summary-work-articles n) wide))
1369 (defun gnus-summary-wide-reply (&optional yank)
1370 "Start composing a wide reply mail to the current message.
1371 If prefix argument YANK is non-nil, the original article is yanked
1374 (list (and current-prefix-arg
1375 (gnus-summary-work-articles 1))))
1376 (gnus-summary-reply yank t))
1378 (defun gnus-summary-wide-reply-with-original (n)
1379 "Start composing a wide reply mail to the current message.
1380 The original article will be yanked.
1381 Uses the process/prefix convention."
1383 (gnus-summary-reply-with-original n t))
1385 (defun gnus-summary-very-wide-reply (&optional yank)
1386 "Start composing a very wide reply mail to the current message.
1387 If prefix argument YANK is non-nil, the original article is yanked
1390 (list (and current-prefix-arg
1391 (gnus-summary-work-articles 1))))
1392 (gnus-summary-reply yank t (gnus-summary-work-articles yank)))
1394 (defun gnus-summary-very-wide-reply-with-original (n)
1395 "Start composing a very wide reply mail to the current message.
1396 The original article will be yanked."
1399 (gnus-summary-work-articles n) t (gnus-summary-work-articles n)))
1401 (defun gnus-summary-mail-forward (&optional full-headers post)
1402 "Forward the current message(s) to another user.
1403 If process marks exist, forward all marked messages;
1404 If FULL-HEADERS (the prefix), include full headers when forwarding.
1406 Note that this function definition for T-gnus is totally different
1407 from the original Gnus."
1409 (if (cdr (gnus-summary-work-articles nil))
1410 ;; Process marks are given.
1411 (gnus-summary-digest-mail-forward nil post)
1412 ;; No process marks.
1413 (let* ((gnus-article-reply (gnus-summary-article-number))
1414 (gnus-article-yanked-articles (list gnus-article-reply))
1416 (message-included-forward-headers
1417 (if full-headers "" message-included-forward-headers)))
1418 (gnus-setup-message 'forward
1419 (gnus-summary-select-article)
1420 (setq charset default-mime-charset)
1421 (set-buffer gnus-original-article-buffer)
1422 (make-local-variable 'default-mime-charset)
1423 (setq default-mime-charset charset)
1424 (message-forward post)))))
1426 (defun gnus-summary-digest-mail-forward (&optional n post)
1427 "Digests and forwards all articles in this series.
1428 If N is a positive number, forward the N next articles.
1429 If N is a negative number, forward the N previous articles.
1430 If N is nil and any articles have been marked with the process mark,
1431 forward those articles instead.
1432 Optional POST will use news to forward instead of mail."
1434 (let* ((articles (gnus-summary-work-articles n))
1435 (gnus-article-yanked-articles (copy-sequence articles))
1436 (topics "Topics:\n")
1437 subject article frame)
1438 (when (car articles)
1439 (gnus-setup-message 'forward
1440 (gnus-summary-select-article)
1442 (setq articles (sort articles '<)
1443 subject "Digested Articles")
1444 (with-current-buffer gnus-original-article-buffer
1445 (setq subject (message-make-forward-subject))))
1447 (message-news nil subject)
1448 (message-mail nil subject))
1449 (when (and message-use-multi-frames (cdr articles))
1450 (setq frame (window-frame (get-buffer-window (current-buffer)))))
1452 (while (setq article (pop articles))
1453 (save-window-excursion
1454 (set-buffer gnus-summary-buffer)
1455 (gnus-summary-select-article nil nil nil article)
1456 (setq topics (concat topics " "
1457 (mail-header-subject gnus-current-headers)
1459 (gnus-summary-remove-process-mark article))
1461 (select-frame frame))
1462 (insert (mime-make-tag "message" "rfc822") "\n")
1463 (narrow-to-region (point) (point))
1464 (insert-buffer-substring gnus-original-article-buffer)
1466 (article-narrow-to-head)
1467 (message-remove-header message-included-forward-headers t nil t))
1468 (goto-char (point-max))
1474 (mime-edit-enclose-digest-region (point)(mark t))))))
1476 (defun gnus-summary-digest-post-forward (&optional n)
1477 "Digest and forwards all articles in this series to a newsgroup.
1478 If N is a positive number, forward the N next articles.
1479 If N is a negative number, forward the N previous articles.
1480 If N is nil and any articles have been marked with the process mark,
1481 forward those articles instead."
1483 (gnus-summary-digest-mail-forward n t))
1485 (defun gnus-summary-resend-message (address n)
1486 "Resend the current article to ADDRESS."
1488 (list (message-read-from-minibuffer
1489 "Resend message(s) to: "
1490 (when (and gnus-summary-resend-default-address
1491 (gnus-buffer-live-p gnus-original-article-buffer))
1492 ;; If some other article is currently selected, the
1493 ;; initial-contents is wrong. Whatever, it is just the
1494 ;; initial-contents.
1495 (with-current-buffer gnus-original-article-buffer
1496 (nnmail-fetch-field "to"))))
1497 current-prefix-arg))
1498 (let ((articles (gnus-summary-work-articles n))
1500 (while (setq article (pop articles))
1501 (gnus-summary-select-article nil nil nil article)
1503 (set-buffer gnus-original-article-buffer)
1504 (message-resend address))
1505 (gnus-summary-mark-article-as-forwarded article))))
1507 ;; From: Matthieu Moy <Matthieu.Moy@imag.fr>
1508 (defun gnus-summary-resend-message-edit ()
1509 "Resend an article that has already been sent.
1510 A new buffer will be created to allow the user to modify body and
1511 contents of the message, and then, everything will happen as when
1512 composing a new message."
1514 (let ((article (gnus-summary-article-number)))
1515 (gnus-setup-message 'reply-yank
1516 (gnus-summary-select-article t)
1517 (set-buffer gnus-original-article-buffer)
1518 (let ((cur (current-buffer))
1519 (to (message-fetch-field "to")))
1520 ;; Get a normal message buffer.
1521 (message-pop-to-buffer (message-buffer-name "Resend" to))
1522 (insert-buffer-substring cur)
1524 ;; T-gnus change: Use MIME-Edit to recompose a message.
1526 (let ((ofn (symbol-function 'mime-edit-decode-single-part-in-buffer)))
1527 (fset 'mime-edit-decode-single-part-in-buffer
1528 (lambda (&rest args)
1529 (if (let ((content-type (car args)))
1530 (and (eq 'message (mime-content-type-primary-type
1532 (eq 'rfc822 (mime-content-type-subtype
1534 (setcar (cdr args) 'not-decode-text))
1537 (mime-edit-again nil t)
1538 (fset 'mime-edit-decode-single-part-in-buffer ofn)))
1539 (message-narrow-to-head-1)
1540 (insert "From: " (message-make-from) "\n")
1541 (while (re-search-forward "^From:" nil t)
1543 (insert "Original-"))
1544 (message-remove-header "^>From[\t ]" t)
1546 ;; Gnus will generate a new one when sending.
1547 (message-remove-header "Message-ID")
1548 (message-remove-header message-ignored-resent-headers t)
1549 ;; Remove unwanted headers.
1550 (goto-char (point-max))
1551 (insert mail-header-separator)
1552 (goto-char (point-min))
1553 (re-search-forward "^To:\\|^Newsgroups:" nil 'move)
1557 (defun gnus-summary-post-forward (&optional full-headers)
1558 "Forward the current article to a newsgroup.
1559 If FULL-HEADERS (the prefix), include full headers when forwarding."
1561 (gnus-summary-mail-forward full-headers t))
1563 (defvar gnus-nastygram-message
1564 "The following article was inappropriately posted to %s.\n\n"
1565 "Format string to insert in nastygrams.
1566 The current group name will be inserted at \"%s\".")
1568 (defun gnus-summary-mail-nastygram (n)
1569 "Send a nastygram to the author of the current article."
1571 (when (or gnus-expert-user
1573 "Really send a nastygram to the author of the current article? "))
1574 (let ((group gnus-newsgroup-name))
1575 (gnus-summary-reply-with-original n)
1576 (set-buffer gnus-message-buffer)
1578 (insert (format gnus-nastygram-message group))
1579 (message-send-and-exit))))
1581 (defun gnus-summary-mail-crosspost-complaint (n)
1582 "Send a complaint about crossposting to the current article(s)."
1584 (let ((articles (gnus-summary-work-articles n))
1586 (while (setq article (pop articles))
1587 (set-buffer gnus-summary-buffer)
1588 (gnus-summary-goto-subject article)
1589 (let ((group (gnus-group-real-name gnus-newsgroup-name))
1590 newsgroups followup-to)
1591 (gnus-summary-select-article)
1592 (set-buffer gnus-original-article-buffer)
1593 (if (and (<= (length (message-tokenize-header
1595 (mail-fetch-field "newsgroups"))
1598 (or (not (setq followup-to (mail-fetch-field "followup-to")))
1599 (not (member group (message-tokenize-header
1600 followup-to ", ")))))
1602 (gnus-message 1 "Followup-to restricted")
1603 (gnus-message 1 "Not a crossposted article"))
1604 (set-buffer gnus-summary-buffer)
1605 (gnus-summary-reply-with-original 1)
1606 (set-buffer gnus-message-buffer)
1608 (insert (format gnus-crosspost-complaint newsgroups group))
1609 (message-goto-subject)
1610 (re-search-forward " *$")
1611 (replace-match " (crosspost notification)" t t)
1612 (gnus-deactivate-mark)
1613 (when (gnus-y-or-n-p "Send this complaint? ")
1614 (message-send-and-exit)))))))
1616 (defun gnus-mail-parse-comma-list ()
1619 (skip-chars-forward " ")
1622 (skip-chars-forward "^,")
1627 (narrow-to-region beg (point))
1630 (while (search-forward "\"" nil t)
1634 (skip-chars-forward ",")
1635 (skip-chars-forward "^,"))
1636 (skip-chars-backward " ")
1637 (push (buffer-substring beg (point))
1639 (skip-chars-forward "^,")
1640 (skip-chars-forward ", "))
1643 (defun gnus-inews-add-to-address (group)
1644 (let ((to-address (mail-fetch-field "to")))
1645 (when (and to-address
1647 ;; This mail group doesn't have a `to-list', so we add one
1649 (when (gnus-y-or-n-p
1650 (format "Do you want to add this as `to-list': %s? " to-address))
1651 (gnus-group-add-parameter group (cons 'to-list to-address))))))
1653 (defun gnus-put-message ()
1654 "Put the current message in some group and return to Gnus."
1656 (let ((reply gnus-article-reply)
1657 (winconf gnus-prev-winconf)
1658 (group gnus-newsgroup-name))
1660 (not (gnus-group-read-only-p group)))
1661 (setq group (read-string "Put in group: " nil (gnus-writable-groups))))
1663 (when (gnus-gethash group gnus-newsrc-hashtb)
1664 (error "No such group: %s" group))
1668 (message-narrow-to-headers)
1669 (let ((gnus-deletable-headers nil))
1670 (message-generate-headers
1671 (if (message-news-p)
1672 message-required-news-headers
1673 message-required-mail-headers)))
1674 (goto-char (point-max))
1675 (if (string-match " " group)
1676 (insert "Gcc: \"" group "\"\n")
1677 (insert "Gcc: " group "\n"))
1680 (when (and (get-buffer gnus-group-buffer)
1681 (gnus-buffer-exists-p (car-safe reply))
1683 (set-buffer (car reply))
1684 (gnus-summary-mark-article-as-replied (cdr reply)))
1686 (set-window-configuration winconf))))
1688 (defun gnus-article-mail (yank)
1689 "Send a reply to the address near point.
1690 If YANK is non-nil, include the original article."
1694 (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point)))
1695 (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point))))))
1697 (gnus-msg-mail address)
1699 (gnus-inews-yank-articles (list (cdr gnus-article-current)))))))
1701 (defvar nntp-server-type)
1703 "Send a bug report to the Gnus maintainers."
1705 (unless (gnus-alive-p)
1706 (error "Gnus has been shut down"))
1707 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
1708 (unless (message-mail-user-agent)
1709 (message-pop-to-buffer "*Gnus Bug*")
1710 (delete-other-windows)
1711 (when gnus-bug-create-help-buffer
1712 (switch-to-buffer "*Gnus Help Bug*")
1714 (insert gnus-bug-message)
1715 (goto-char (point-min))
1717 (set-buffer "*Gnus Bug*")))
1718 (let ((message-this-is-mail t))
1719 (message-setup `((To . ,gnus-maintainer) (Subject . ""))))
1720 (when gnus-bug-create-help-buffer
1721 (push `(gnus-bug-kill-buffer) message-send-actions))
1722 (goto-char (point-min))
1723 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
1725 (insert gnus-product-name " " gnus-version-number
1726 " (r" gnus-revision-number ") "
1727 "based on " gnus-original-product-name " v"
1728 gnus-original-version-number "\n"
1729 (emacs-version) "\n")
1730 (when (and (boundp 'nntp-server-type)
1731 (stringp nntp-server-type))
1732 (insert nntp-server-type))
1733 (insert "\n\n\n\n\n")
1734 (let (mime-content-types)
1735 (mime-edit-insert-tag
1736 "application" "emacs-lisp"
1737 "\nContent-Disposition: inline\nContent-Description: User settings"))
1738 (insert (with-temp-buffer
1741 (let (mime-content-types)
1742 (mime-edit-insert-tag "text" "plain"))
1743 (goto-char (point-min))
1744 (search-forward "Subject: " nil t)
1747 (defun gnus-bug-kill-buffer ()
1748 (when (get-buffer "*Gnus Help Bug*")
1749 (kill-buffer "*Gnus Help Bug*")))
1751 (defun gnus-summary-yank-message (buffer n)
1752 "Yank the current article into a composed message."
1754 (list (completing-read "Buffer: " (mapcar 'list (message-buffers)) nil t)
1755 current-prefix-arg))
1756 (when (gnus-buffer-live-p buffer)
1757 (let ((summary-frame (selected-frame))
1758 (message-frame (when (static-if (featurep 'xemacs)
1759 (device-on-window-system-p)
1761 (let ((window (get-buffer-window buffer t)))
1763 (window-frame window)))))
1764 (separator (concat "^" (regexp-quote mail-header-separator)
1766 (gnus-summary-iterate n
1767 (gnus-summary-select-article)
1768 (gnus-copy-article-buffer)
1769 (when (frame-live-p message-frame)
1770 (raise-frame message-frame)
1771 (select-frame message-frame))
1772 (with-current-buffer buffer
1773 (when (save-excursion
1775 (let (case-fold-search)
1776 (and (not (re-search-backward separator nil t))
1777 (re-search-forward separator nil t))))
1778 (goto-char (match-end 0)))
1779 (message-yank-buffer gnus-article-copy))
1780 (select-frame summary-frame))
1781 (when (frame-live-p message-frame)
1782 (select-frame message-frame)))))
1784 (defun gnus-debug ()
1785 "Attempts to go through the Gnus source file and report what variables have been changed.
1786 The source file has to be in the Emacs load path."
1788 (let ((files gnus-debug-files)
1790 file expr olist sym)
1791 (gnus-message 4 "Please wait while we snoop your variables...")
1792 ;; Go through all the files looking for non-default values for variables.
1795 (set-buffer (gnus-get-buffer-create " *gnus bug info*"))
1798 (when (and (setq file (locate-library (pop files)))
1799 (file-exists-p file))
1800 (insert-file-contents file)
1801 (goto-char (point-min))
1802 (if (not (re-search-forward "^;;* *Internal variables" nil t))
1803 (gnus-message 4 "Malformed sources in file %s" file)
1804 (narrow-to-region (point-min) (point))
1805 (goto-char (point-min))
1806 (while (setq expr (ignore-errors (read (current-buffer))))
1808 (and (memq (car expr) '(defvar defcustom defvoo))
1809 (stringp (nth 3 expr))
1810 (not (memq (nth 1 expr) gnus-debug-exclude-variables))
1811 (or (not (boundp (nth 1 expr)))
1812 (not (equal (eval (nth 2 expr))
1813 (symbol-value (nth 1 expr)))))
1814 (push (nth 1 expr) olist)))))))
1815 (kill-buffer (current-buffer)))
1816 (when (setq olist (nreverse olist))
1817 (insert ";----------------- Environment follows ------------------\n\n"))
1819 (if (boundp (car olist))
1821 (pp `(setq ,(car olist)
1822 ,(if (or (consp (setq sym (symbol-value (car olist))))
1824 (not (or (eq sym nil)
1826 (list 'quote (symbol-value (car olist)))
1827 (symbol-value (car olist))))
1829 (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
1830 (setq olist (cdr olist)))
1831 ;; Remove any control chars - they seem to cause trouble for some
1832 ;; mailers. (Byte-compiled output from the stuff above.)
1834 (while (re-search-forward "[\000-\010\013-\037\200-\237]" nil t)
1835 (replace-match (format "\\%03o" (string-to-char (match-string 0)))
1837 ;; Break MIME tags purposely.
1839 (while (re-search-forward mime-edit-tag-regexp nil t)
1840 (goto-char (1+ (match-beginning 0)))
1843 ;;; Treatment of rejected articles.
1846 (defun gnus-summary-resend-bounced-mail (&optional fetch)
1847 "Re-mail the current message.
1848 This only makes sense if the current message is a bounce message than
1849 contains some mail you have written which has been bounced back to
1851 If FETCH, try to fetch the article that this is a reply to, if indeed
1854 (gnus-summary-select-article t)
1855 (set-buffer gnus-original-article-buffer)
1856 (gnus-setup-message 'compose-bounce
1857 (let* ((references (mail-fetch-field "references"))
1858 (parent (and references (gnus-parent-id references))))
1860 ;; If there are references, we fetch the article we answered to.
1862 (gnus-summary-refer-article parent)
1863 (gnus-summary-show-all-headers)))))
1867 (defun gnus-inews-group-method (group)
1869 ;; If the group doesn't exist, we assume
1870 ;; it's an archive group...
1871 ((and (null (gnus-get-info group))
1872 (eq (car (gnus-server-to-method gnus-message-archive-method))
1873 (car (gnus-server-to-method (gnus-group-method group)))))
1874 gnus-message-archive-method)
1876 ((gnus-info-method (gnus-get-info group))
1877 (gnus-info-method (gnus-get-info group)))
1879 (t (gnus-server-to-method (gnus-group-method group)))))
1881 ;; Do Gcc handling, which copied the message over to some group.
1882 (defun gnus-inews-do-gcc (&optional gcc)
1886 (message-narrow-to-headers)
1887 (let ((gcc (or gcc (mail-fetch-field "gcc" nil t)))
1888 (coding-system-for-write 'raw-text)
1889 (output-coding-system 'raw-text)
1890 groups group method group-art
1891 mml-externalize-attachments)
1893 (message-remove-header "gcc")
1895 (setq groups (message-unquote-tokens
1896 (message-tokenize-header gcc " ,")))
1897 ;; Copy the article over to some group(s).
1898 (while (setq group (pop groups))
1899 (unless (gnus-check-server
1900 (setq method (gnus-inews-group-method group)))
1901 (error "Can't open server %s" (if (stringp method) method
1903 (unless (gnus-request-group group nil method)
1904 (gnus-request-create-group group method))
1905 (setq mml-externalize-attachments
1906 (if (stringp gnus-gcc-externalize-attachments)
1907 (string-match gnus-gcc-externalize-attachments group)
1908 gnus-gcc-externalize-attachments))
1910 (nnheader-set-temp-buffer " *acc*")
1911 (insert-buffer-substring message-encoding-buffer)
1912 (gnus-run-hooks 'gnus-before-do-gcc-hook)
1913 (goto-char (point-min))
1914 (when (re-search-forward
1915 (concat "^" (regexp-quote mail-header-separator) "$")
1917 (replace-match "" t t ))
1918 (unless (setq group-art
1919 (gnus-request-accept-article group method t t))
1920 (gnus-message 1 "Couldn't store article in group %s: %s"
1921 group (gnus-status-message method))
1923 (when (and group-art
1924 ;; FIXME: Should gcc-mark-as-read work when
1925 ;; Gnus is not running?
1927 (or gnus-gcc-mark-as-read
1929 (boundp 'gnus-inews-mark-gcc-as-read)
1930 (symbol-value 'gnus-inews-mark-gcc-as-read))))
1931 (gnus-group-mark-article-read group (cdr group-art)))
1932 (kill-buffer (current-buffer)))))))))
1934 (defun gnus-inews-insert-gcc ()
1935 "Insert Gcc headers based on `gnus-outgoing-message-group'."
1938 (message-narrow-to-headers)
1939 (let* ((group gnus-outgoing-message-group)
1943 ((or (stringp group) (list group))
1948 (if (string-match " " gcc)
1949 (concat "\"" gcc "\"")
1951 (mapconcat (lambda (group)
1952 (if (string-match " " group)
1953 (concat "\"" group "\"")
1958 (defun gnus-inews-insert-archive-gcc (&optional group)
1959 "Insert the Gcc to say where the article is to be archived."
1960 (let* ((var gnus-message-archive-group)
1961 (group (or group gnus-newsgroup-name ""))
1963 (and gnus-newsgroup-name
1964 (not (equal gnus-newsgroup-name ""))
1965 (gnus-group-find-parameter
1966 gnus-newsgroup-name 'gcc-self)))
1970 ((null gnus-message-archive-method)
1974 ;; Just a single group.
1977 ;; We don't want this.
1979 ((and (listp var) (stringp (car var)))
1980 ;; A list of groups.
1984 (funcall var group))
1986 ;; An alist of regexps/functions/forms.
1991 ((stringp (caar var))
1993 (when (string-match (caar var) group)
1995 ((functionp (car var))
1997 (funcall (car var) group))
1999 (eval (car var)))))))
2000 (setq var (cdr var)))
2003 (when (or groups gcc-self-val)
2004 (when (stringp groups)
2005 (setq groups (list groups)))
2008 (message-narrow-to-headers)
2009 (goto-char (point-max))
2012 ;; Use the `gcc-self' param value instead.
2015 (if (stringp gcc-self-val)
2016 (if (string-match " " gcc-self-val)
2017 (concat "\"" gcc-self-val "\"")
2019 (if (string-match " " group)
2020 (concat "\"" group "\"")
2022 (if (not (eq gcc-self-val 'none))
2024 (gnus-delete-line)))
2025 ;; Use the list of groups.
2026 (while (setq name (pop groups))
2027 (let ((str (if (string-match ":" name)
2029 (gnus-group-prefixed-name
2030 name gnus-message-archive-method))))
2031 (insert (if (string-match " " str)
2032 (concat "\"" str "\"")
2038 (defun gnus-mailing-list-followup-to ()
2039 "Look at the headers in the current buffer and return a Mail-Followup-To address."
2040 (let ((x-been-there (gnus-fetch-original-field "x-beenthere"))
2041 (list-post (gnus-fetch-original-field "list-post")))
2042 (when (and list-post
2043 (string-match "mailto:\\([^>]+\\)" list-post))
2044 (setq list-post (match-string 1 list-post)))
2050 (defun gnus-configure-posting-styles (&optional group-name)
2051 "Configure posting styles according to `gnus-posting-styles'."
2052 (unless gnus-inhibit-posting-styles
2053 (let ((group (or group-name gnus-newsgroup-name ""))
2054 (styles gnus-posting-styles)
2055 style match attribute results
2057 ;; If the group has a posting-style parameter, add it at the end with a
2058 ;; regexp matching everything, to be sure it takes precedence over all
2060 (when gnus-newsgroup-name
2061 (let ((tmp-style (gnus-group-find-parameter group 'posting-style t)))
2063 (setq styles (append styles (list (cons ".*" tmp-style)))))))
2064 ;; Go through all styles and look for matches.
2065 (dolist (style styles)
2066 (setq match (pop style))
2067 (goto-char (point-min))
2070 ;; Regexp string match on the group name.
2071 (string-match match group))
2073 ;; Obsolete format of header match.
2074 (and (gnus-buffer-live-p gnus-article-copy)
2075 (with-current-buffer gnus-article-copy
2076 (let ((header (message-fetch-field (pop style))))
2078 (string-match (pop style) header))))))
2079 ((or (symbolp match)
2083 ;; Function to be called.
2086 ;; Variable to be checked.
2087 (symbol-value match))))
2090 ((eq (car match) 'header)
2091 ;; New format of header match.
2092 (and (gnus-buffer-live-p gnus-article-copy)
2093 (with-current-buffer gnus-article-copy
2094 (let ((header (message-fetch-field (nth 1 match))))
2096 (string-match (nth 2 match) header))))))
2098 ;; This is a form to be evaled.
2100 ;; We have a match, so we set the variables.
2101 (setq style (gnus-configure-posting-style style nil))
2102 (dolist (attribute style)
2103 (setq results (delq (assoc (car attribute) results) results))
2104 (push attribute results))))
2105 ;; Now we have all the styles, so we insert them.
2106 (setq name (assq 'name results)
2107 address (assq 'address results))
2108 (setq results (delq name (delq address results)))
2109 (gnus-make-local-hook 'message-setup-hook)
2110 (setq results (sort results (lambda (x y)
2111 (string-lessp (car x) (car y)))))
2112 (dolist (result results)
2113 (add-hook 'message-setup-hook
2115 ((eq 'eval (car result))
2117 ((eq 'body (car result))
2121 (insert ,(cdr result)))))
2122 ((eq 'signature (car result))
2123 (set (make-local-variable 'message-signature) nil)
2124 (set (make-local-variable 'message-signature-file) nil)
2125 (if (not (cdr result))
2129 (let ((message-signature ,(cdr result)))
2130 (when message-signature
2131 (message-insert-signature)))))))
2134 (if (symbolp (car result))
2135 (capitalize (symbol-name (car result)))
2139 (message-remove-header ,header)
2140 (let ((value ,(cdr result)))
2143 (insert ,header ": " value)
2145 (insert "\n")))))))))
2147 (when (or name address)
2148 (add-hook 'message-setup-hook
2150 (set (make-local-variable 'user-mail-address)
2151 ,(or (cdr address) user-mail-address))
2152 (let ((user-full-name ,(or (cdr name) (user-full-name)))
2154 ,(or (cdr address) user-mail-address)))
2156 (message-remove-header "From")
2158 (insert "From: " (message-make-from) "\n"))))
2161 ;; splitted from gnus-configure-posting-styles to allow recursive traversal.
2162 (defun gnus-configure-posting-style (style stack)
2163 "Parse one posting style STYLE and returns the value as an alist."
2164 (let (results element variable filep value v)
2165 (dolist (attribute style)
2166 (setq element (pop attribute)
2171 ((eq (car attribute) ':file)
2174 ((eq (car attribute) :value)
2178 ;; We get the value.
2183 ((or (symbolp value)
2185 (cond ((functionp value)
2188 (symbol-value value))))
2191 ;; Translate obsolescent value.
2193 ((eq element 'signature-file)
2194 (setq element 'signature
2196 ((eq element 'x-face-file)
2197 (setq element 'x-face
2199 ;; Get the contents of file elems.
2201 (setq v (with-temp-buffer
2202 (insert-file-contents v)
2203 (goto-char (point-max))
2207 (if (eq element 'import)
2209 (if (member v stack)
2210 (error "Circular import of \"%s\"" v))
2212 (nconc (nreverse (gnus-configure-posting-style
2213 (cdr (assoc v gnus-named-posting-styles))
2216 (push (cons element v) results)))
2217 (nreverse results)))
2219 (defun gnus-summary-execute-command-with-posting-style (style command)
2220 "Temporarily select a posting-style named STYLE and execute COMMAND."
2222 (let ((style (completing-read "Posting style: "
2223 gnus-named-posting-styles nil t)))
2227 (format "Command to execute with %s: " style))))))
2228 (let ((gnus-posting-styles (list (list ".*" (list 'import style)))))
2229 (call-interactively command)))
2232 ;;; @ for MIME Edit mode
2235 (defun gnus-maybe-setup-default-charset ()
2237 (and (boundp 'gnus-summary-buffer)
2238 (buffer-live-p gnus-summary-buffer)
2240 (set-buffer gnus-summary-buffer)
2241 default-mime-charset))))
2244 (make-local-variable 'default-mime-charset)
2245 (setq default-mime-charset charset)
2249 ;;; @ for MIME view mode
2252 (defun gnus-following-method (buf)
2253 (gnus-setup-message 'reply-yank
2255 (if (message-news-p)
2257 (message-reply nil 'wide))
2258 (let ((message-reply-buffer buf))
2259 (message-yank-original))
2260 (message-goto-body))
2264 ;;; Allow redefinition of functions.
2270 ;;; gnus-msg.el ends here