1 ;;; gnus-msg.el --- mail and post interface for Semi-gnus
2 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
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))
42 (defcustom gnus-post-method 'current
43 "*Preferred method for posting USENET news.
45 If this variable is `current', Gnus will use the \"current\" select
46 method when posting. If it is nil (which is the default), Gnus will
47 use the native select method when posting.
49 This method will not be used in mail groups and the like, only in
52 If not nil nor `native', the value must be a valid method as discussed
53 in the documentation of `gnus-select-method'. It can also be a list of
54 methods. If that is the case, the user will be queried for what select
55 method to use when posting."
56 :group 'gnus-group-foreign
57 :type `(choice (const nil)
60 (sexp :tag "Methods" ,gnus-select-method)))
62 (defvar gnus-outgoing-message-group nil
63 "*All outgoing messages will be put in this group.
64 If you want to store all your outgoing mail and articles in the group
65 \"nnml:archive\", you set this variable to that value. This variable
66 can also be a list of group names.
68 If you want to have greater control over what group to put each
69 message in, you can set this variable to a function that checks the
70 current newsgroup name and then returns a suitable group name (or list
73 (defvar gnus-mailing-list-groups nil
74 "*Regexp matching groups that are really mailing lists.
75 This is useful when you're reading a mailing list that has been
76 gatewayed to a newsgroup, and you want to followup to an article in
79 (defvar gnus-add-to-list nil
80 "*If non-nil, add a `to-list' parameter automatically.")
82 (defvar gnus-crosspost-complaint
85 You posted the article below with the following Newsgroups header:
89 The %s group, at least, was an inappropriate recipient
90 of this message. Please trim your Newsgroups header to exclude this
91 group before posting in the future.
96 "Format string to be inserted when complaining about crossposts.
97 The first %s will be replaced by the Newsgroups header;
98 the second with the current group name.")
100 (defvar gnus-message-setup-hook '(gnus-maybe-setup-default-charset)
101 "Hook run after setting up a message buffer.")
103 (defvar gnus-bug-create-help-buffer t
104 "*Should we create the *Gnus Help Bug* buffer?")
106 (defvar gnus-posting-styles nil
107 "*Alist of styles to use when posting.")
109 (defvar gnus-inews-mark-gcc-as-read nil
110 "If non-nil, automatically mark Gcc articles as read.")
112 (defcustom gnus-group-posting-charset-alist
113 '(("^\\(no\\|fr\\)\\.[^,]*\\(,[ \t\n]*\\(no\\|fr\\)\\.[^,]*\\)*$" iso-8859-1 (iso-8859-1))
114 ("^\\(fido7\\|relcom\\)\\.[^,]*\\(,[ \t\n]*\\(fido7\\|relcom\\)\\.[^,]*\\)*$" koi8-r (koi8-r))
115 (message-this-is-mail nil nil)
116 (message-this-is-news nil t))
117 "Alist of regexps and permitted unencoded charsets for posting.
118 Each element of the alist has the form (TEST HEADER BODY-LIST), where
119 TEST is either a regular expression matching the newsgroup header or a
121 HEADER is the charset which may be left unencoded in the header (nil
122 means encode all charsets),
123 BODY-LIST is a list of charsets which may be encoded using 8bit
124 content-transfer encoding in the body, or one of the special values
125 nil (always encode using quoted-printable) or t (always use 8bit).
127 Note that any value other than nil for HEADER infringes some RFCs, so
128 use this option with care."
129 :type '(repeat (list :tag "Permitted unencoded charsets"
131 (regexp :tag "Group")
132 (const :tag "Mail message" :value message-this-is-mail)
133 (const :tag "News article" :value message-this-is-news))
134 (choice :tag "Header"
135 (const :tag "None" nil)
136 (symbol :tag "Charset"))
138 (const :tag "Any" :value t)
139 (const :tag "None" :value nil)
140 (repeat :tag "Charsets"
141 (symbol :tag "Charset")))))
142 :group 'gnus-charset)
144 ;;; Internal variables.
146 (defvar gnus-inhibit-posting-styles nil
147 "Inhibit the use of posting styles.")
149 (defvar gnus-message-buffer "*Mail Gnus*")
150 (defvar gnus-article-copy nil)
151 (defvar gnus-check-before-posting nil)
152 (defvar gnus-last-posting-server nil)
153 (defvar gnus-message-group-art nil)
155 (defconst gnus-bug-message
156 (format "Sending a bug report to the Gnus Towers.
157 ========================================
159 This gnus is the %s%s.
160 If you think the bug is a Semi-gnus bug, send a bug report to Semi-gnus
161 Developers. (the addresses below are mailing list addresses)
163 ========================================
165 The buffer below is a mail buffer. When you press `C-c C-c', it will
166 be sent to the Gnus Bug Exterminators.
168 The thing near the bottom of the buffer is how the environment
169 settings will be included in the mail. Please do not delete that.
170 They will tell the Bug People what your environment is, so that it
171 will be easier to locate the bugs.
173 If you have found a bug that makes Emacs go \"beep\", set
174 debug-on-error to t (`M-x set-variable RET debug-on-error RET t RET')
175 and include the backtrace in your bug report.
177 Please describe the bug in annoying, painstaking detail.
179 Thank you for your help in stamping out bugs.
182 (if (string= gnus-product-name "Semi-gnus")
184 ", a modified version of Semi-gnus")))
187 (autoload 'gnus-uu-post-news "gnus-uu" nil t)
188 (autoload 'news-setup "rnewspost")
189 (autoload 'news-reply-mode "rnewspost")
190 (autoload 'rmail-dont-reply-to "mail-utils")
191 (autoload 'rmail-output "rmailout"))
195 ;;; Gnus Posting Functions
198 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map)
199 "p" gnus-summary-post-news
200 "f" gnus-summary-followup
201 "F" gnus-summary-followup-with-original
202 "c" gnus-summary-cancel-article
203 "s" gnus-summary-supersede-article
204 "r" gnus-summary-reply
205 "y" gnus-summary-yank-message
206 "R" gnus-summary-reply-with-original
207 "w" gnus-summary-wide-reply
208 "W" gnus-summary-wide-reply-with-original
209 "n" gnus-summary-followup-to-mail
210 "N" gnus-summary-followup-to-mail-with-original
211 "m" gnus-summary-mail-other-window
212 "u" gnus-uu-post-news
213 "\M-c" gnus-summary-mail-crosspost-complaint
214 "om" gnus-summary-mail-forward
215 "op" gnus-summary-post-forward
216 "Om" gnus-uu-digest-mail-forward
217 "Op" gnus-uu-digest-post-forward)
219 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
220 "b" gnus-summary-resend-bounced-mail
221 ;; "c" gnus-summary-send-draft
222 "r" gnus-summary-resend-message)
224 ;;; Internal functions.
226 (defvar gnus-article-reply nil)
227 (defmacro gnus-setup-message (config &rest forms)
228 (let ((winconf (make-symbol "gnus-setup-message-winconf"))
229 (buffer (make-symbol "gnus-setup-message-buffer"))
230 (article (make-symbol "gnus-setup-message-article"))
231 (group (make-symbol "gnus-setup-message-group")))
232 `(let ((,winconf (current-window-configuration))
233 (,buffer (buffer-name (current-buffer)))
234 (,article (and gnus-article-reply (gnus-summary-article-number)))
235 (,group gnus-newsgroup-name)
236 (message-header-setup-hook
237 (copy-sequence message-header-setup-hook))
238 (message-mode-hook (copy-sequence message-mode-hook))
239 (message-startup-parameter-alist
240 '((reply-buffer . gnus-copy-article-buffer)
241 (original-buffer . gnus-original-article-buffer)
242 (user-agent . Gnus))))
243 (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
244 (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
245 (add-hook 'message-mode-hook 'gnus-configure-posting-styles)
249 (gnus-inews-add-send-actions ,winconf ,buffer ,article)
250 (gnus-inews-insert-draft-meta-information ,group ,article)
251 (setq gnus-message-buffer (current-buffer))
252 (set (make-local-variable 'gnus-message-group-art)
253 (cons ,group ,article))
254 (set (make-local-variable 'gnus-newsgroup-name) ,group)
255 (gnus-run-hooks 'gnus-message-setup-hook))
257 (gnus-configure-windows ,config t)
258 (set-buffer-modified-p nil))))
260 (defun gnus-inews-insert-draft-meta-information (group article)
263 (not (string= group ""))
264 (not (message-fetch-field gnus-draft-meta-information-header)))
265 (goto-char (point-min))
266 (insert gnus-draft-meta-information-header ": (\"" group "\" "
267 (if article (number-to-string article) "\"\"") ")\n"))))
270 (defun gnus-msg-mail (&optional to subject other-headers continue
271 switch-action yank-action send-actions)
272 "Start editing a mail message to be sent.
273 Like `message-mail', but with Gnus paraphernalia, particularly the
274 Gcc: header for archiving purposes."
276 (let ((buf (current-buffer))
278 (gnus-setup-message 'message
279 (message-mail to subject other-headers continue
280 nil yank-action send-actions))
282 (setq mail-buf (current-buffer))
283 (switch-to-buffer buf)
284 (apply switch-action mail-buf nil)))
285 ;; COMPOSEFUNC should return t if succeed. Undocumented ???
289 (defun gnus-button-mailto (address)
291 (set-buffer (gnus-copy-article-buffer))
292 (gnus-setup-message 'message
293 (message-reply address)))
296 (defun gnus-button-reply (&optional to-address wide)
297 "Like `message-reply'."
299 (gnus-setup-message 'message
300 (message-reply to-address wide)))
303 (define-mail-user-agent 'gnus-user-agent
304 'gnus-msg-mail 'message-send-and-exit
305 'message-kill-buffer 'message-send-hook)
307 (defun gnus-setup-posting-charset (group)
308 (let ((alist gnus-group-posting-charset-alist)
309 (group (or group ""))
313 (while (setq elem (pop alist))
314 (when (or (and (stringp (car elem))
315 (string-match (car elem) group))
316 (and (gnus-functionp (car elem))
317 (funcall (car elem) group))
318 (and (symbolp (car elem))
319 (symbol-value (car elem))))
320 (throw 'found (cons (cadr elem) (caddr elem)))))))))
322 (defun gnus-inews-add-send-actions (winconf buffer article)
323 (make-local-hook 'message-sent-hook)
324 (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
325 'gnus-inews-do-gcc) nil t)
327 (make-local-hook 'message-header-hook)
328 (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t))
329 (setq message-post-method
331 (gnus-post-method arg ,gnus-newsgroup-name)))
332 (setq message-user-agent (gnus-extended-version))
333 (when (not message-use-multi-frames)
335 `(set-window-configuration ,winconf) 'exit 'postpone 'kill))
337 `(when (gnus-buffer-exists-p ,buffer)
341 `(gnus-summary-mark-article-as-replied ,article))))
344 (put 'gnus-setup-message 'lisp-indent-function 1)
345 (put 'gnus-setup-message 'edebug-form-spec '(form body))
347 ;;; Post news commands of Gnus group mode and summary mode
349 (defun gnus-group-mail (&optional arg)
350 "Start composing a mail.
351 If ARG, use the group under the point to find a posting style.
352 If ARG is 1, prompt for a group name to find the posting style."
354 ;; We can't `let' gnus-newsgroup-name here, since that leads
355 ;; to local variables leaking.
356 (let ((group gnus-newsgroup-name)
357 (buffer (current-buffer)))
360 (setq gnus-newsgroup-name
362 (if (= 1 (prefix-numeric-value arg))
363 (completing-read "Use posting style of group: "
364 gnus-active-hashtb nil
365 (gnus-read-active-file-p))
366 (gnus-group-group-name))
368 (gnus-setup-message 'message (message-mail)))
371 (setq gnus-newsgroup-name group)))))
373 (defun gnus-group-post-news (&optional arg)
374 "Start composing a news message.
375 If ARG, post to the group under point.
376 If ARG is 1, prompt for a group name."
378 ;; Bind this variable here to make message mode hooks work ok.
379 (let ((gnus-newsgroup-name
381 (if (= 1 (prefix-numeric-value arg))
382 (completing-read "Newsgroup: " gnus-active-hashtb nil
383 (gnus-read-active-file-p))
384 (gnus-group-group-name))
386 (gnus-post-news 'post gnus-newsgroup-name)))
388 (defun gnus-summary-post-news ()
389 "Start composing a news message."
391 (gnus-post-news 'post gnus-newsgroup-name))
393 (defun gnus-summary-followup (yank &optional force-news)
394 "Compose a followup to an article.
395 If prefix argument YANK is non-nil, original article is yanked automatically."
397 (list (and current-prefix-arg
398 (gnus-summary-work-articles 1))))
400 (gnus-summary-goto-subject (car yank)))
401 (save-window-excursion
402 (gnus-summary-select-article))
403 (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
404 (gnus-newsgroup-name gnus-newsgroup-name))
406 (gnus-post-news nil gnus-newsgroup-name
407 headers gnus-article-buffer
408 yank nil force-news)))
410 (defun gnus-summary-followup-with-original (n &optional force-news)
411 "Compose a followup to an article and include the original article."
413 (gnus-summary-followup (gnus-summary-work-articles n) force-news))
415 (defun gnus-summary-followup-to-mail (&optional arg)
416 "Followup to the current mail message via news."
418 (list (and current-prefix-arg
419 (gnus-summary-work-articles 1))))
420 (gnus-summary-followup arg t))
422 (defun gnus-summary-followup-to-mail-with-original (&optional arg)
423 "Followup to the current mail message via news."
425 (gnus-summary-followup (gnus-summary-work-articles arg) t))
427 (defun gnus-inews-yank-articles (articles)
428 (let* ((more-than-one (cdr articles))
429 (frame (when (and message-use-multi-frames more-than-one)
430 (window-frame (get-buffer-window (current-buffer)))))
433 (while (setq article (pop articles))
434 (save-window-excursion
435 (set-buffer gnus-summary-buffer)
436 (gnus-summary-select-article nil nil nil article)
437 (gnus-summary-remove-process-mark article))
439 (select-frame frame))
441 ;; Gathering references.
443 (setq refs (message-list-references
445 (mail-header-references gnus-current-headers)
446 (mail-header-message-id gnus-current-headers))))
448 (gnus-copy-article-buffer)
449 (let ((message-reply-buffer gnus-article-copy)
450 (message-reply-headers
451 (with-current-buffer gnus-article-copy
452 ;; The headers are decoded.
453 (nnheader-parse-head t))))
454 (message-yank-original)
455 (setq beg (or beg (mark t))))
460 ;; Replace with the gathered references.
464 (message-narrow-to-headers)
465 (let ((case-fold-search t))
466 (if (re-search-forward "^References:\\([\t ]+.+\n\\)+" nil t)
468 (goto-char (point-max))))
470 (list (or (assq 'References message-header-format-alist)
471 '(References . message-shorten-references)))
472 (list (cons 'References
473 (mapconcat 'identity (nreverse refs) " "))))
474 (backward-delete-char 1))
480 (defun gnus-summary-cancel-article (&optional n symp)
481 "Cancel an article you posted.
482 Uses the process-prefix convention. If given the symbolic
483 prefix `a', cancel using the standard posting method; if not
484 post using the current select method."
485 (interactive (gnus-interactive "P\ny"))
486 (let ((articles (gnus-summary-work-articles n))
489 (gnus-post-method (not (eq symp 'a)) ,gnus-newsgroup-name)))
491 (while (setq article (pop articles))
492 (when (gnus-summary-select-article t nil nil article)
493 (when (gnus-eval-in-buffer-window gnus-article-buffer
495 (set-buffer gnus-original-article-buffer)
496 (message-cancel-news)))
497 (gnus-summary-mark-as-read article gnus-canceled-mark)
498 (gnus-cache-remove-article 1))
499 (gnus-article-hide-headers-if-wanted))
500 (gnus-summary-remove-process-mark article))))
502 (defun gnus-summary-supersede-article ()
503 "Compose an article that will supersede a previous article.
504 This is done simply by taking the old article and adding a Supersedes
505 header line with the old Message-ID."
507 (let ((article (gnus-summary-article-number))
508 (gnus-message-setup-hook '(gnus-maybe-setup-default-charset)))
509 (gnus-setup-message 'reply-yank
510 (gnus-summary-select-article t)
511 (set-buffer gnus-original-article-buffer)
515 (when (gnus-buffer-exists-p ,gnus-summary-buffer)
517 (set-buffer ,gnus-summary-buffer)
518 (gnus-cache-possibly-remove-article ,article nil nil nil t)
519 (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
520 message-send-actions))))
524 (defun gnus-copy-article-buffer (&optional article-buffer)
525 ;; make a copy of the article buffer with all text properties removed
526 ;; this copy is in the buffer gnus-article-copy.
527 ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
528 ;; this buffer should be passed to all mail/news reply/post routines.
529 (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*"))
530 (let ((article-buffer (or article-buffer gnus-article-buffer))
532 (if (not (and (get-buffer article-buffer)
533 (gnus-buffer-exists-p article-buffer)))
534 (error "Can't find any article buffer")
536 (set-buffer article-buffer)
537 (let ((gnus-newsgroup-charset (or gnus-article-charset
538 gnus-newsgroup-charset))
539 (gnus-newsgroup-ignored-charsets
540 (or gnus-article-ignored-charsets
541 gnus-newsgroup-ignored-charsets)))
543 ;; Copy over the (displayed) article buffer, delete
544 ;; hidden text and remove text properties.
546 (let ((inhibit-read-only t))
547 (copy-to-buffer gnus-article-copy (point-min) (point-max))
548 (set-buffer gnus-article-copy)
549 ;; Encode bitmap smileys to ordinary text.
550 ;; Possibly, the original text might be restored.
551 (static-unless (featurep 'xemacs)
552 (when (featurep 'smiley-mule)
553 (smiley-encode-buffer)))
554 (gnus-article-delete-text-of-type 'annotation)
555 (gnus-remove-text-with-property 'gnus-prev)
556 (gnus-remove-text-with-property 'gnus-next)
557 (gnus-remove-text-with-property 'x-face-mule-bitmap-image)
560 (static-if (featurep 'xemacs)
561 ;; Revome smiley extents for (possibly) XEmacs 21.1.
563 (buffer-substring-no-properties (point-min)
565 (buffer-substring-no-properties (point-min) (point-max)))
567 ;; Find the original headers.
568 (set-buffer gnus-original-article-buffer)
569 (goto-char (point-min))
570 (while (looking-at message-unix-mail-delimiter)
573 (setq end (or (search-forward "\n\n" nil t) (point)))
574 ;; Delete the headers from the displayed articles.
575 (set-buffer gnus-article-copy)
576 (delete-region (goto-char (point-min))
577 (or (search-forward "\n\n" nil t) (point-max)))
578 ;; Insert the original article headers.
579 (insert-buffer-substring gnus-original-article-buffer beg end)
580 (article-decode-encoded-words))))
583 (defun gnus-post-news (post &optional group header article-buffer yank subject
586 (gnus-copy-article-buffer))
587 (let ((gnus-article-reply article-buffer)
588 (add-to-list gnus-add-to-list))
589 (gnus-setup-message (cond (yank 'reply-yank)
590 (article-buffer 'reply)
592 (let* ((group (or group gnus-newsgroup-name))
593 (charset (gnus-group-name-charset nil group))
595 to-address to-group mailing-list to-list
598 (setq to-address (gnus-parameter-to-address group)
599 to-group (gnus-group-find-parameter group 'to-group)
600 to-list (gnus-parameter-to-list group)
601 newsgroup-p (gnus-group-find-parameter group 'newsgroup)
602 mailing-list (when gnus-mailing-list-groups
603 (string-match gnus-mailing-list-groups group))
604 group (gnus-group-name-decode (gnus-group-real-name group)
606 (if (or (and to-group
607 (gnus-news-group-p to-group))
610 (and (gnus-news-group-p
611 (or pgroup gnus-newsgroup-name)
612 (if header (mail-header-number header)
613 gnus-current-article))
619 (message-news (or to-group group))
620 (set-buffer gnus-article-copy)
621 (gnus-msg-treat-broken-reply-to)
622 (message-followup (if (or newsgroup-p force-news) nil to-group)))
626 (message-mail (or to-address to-list))
627 ;; Arrange for mail groups that have no `to-address' to
628 ;; get that when the user sends off the mail.
629 (when (and (not to-list)
632 (push (list 'gnus-inews-add-to-address pgroup)
633 message-send-actions)))
634 (set-buffer gnus-article-copy)
635 (gnus-msg-treat-broken-reply-to)
636 (message-wide-reply to-address)))
638 (gnus-inews-yank-articles yank))))))
640 (defun gnus-msg-treat-broken-reply-to ()
641 "Remove the Reply-to header iff broken-reply-to."
642 (when (gnus-group-find-parameter
643 gnus-newsgroup-name 'broken-reply-to)
645 (message-narrow-to-head)
646 (message-remove-header "reply-to"))))
648 (defun gnus-post-method (arg group &optional silent)
649 "Return the posting method based on GROUP and ARG.
650 If SILENT, don't prompt the user."
651 (let ((group-method (gnus-find-method-for-group group)))
653 ;; If the group-method is nil (which shouldn't happen) we use
654 ;; the default method.
656 (or (and (null (eq gnus-post-method 'active)) gnus-post-method)
657 gnus-select-method message-post-method))
658 ;; We want the inverse of the default
659 ((and arg (not (eq arg 0)))
660 (if (eq gnus-post-method 'active)
663 ;; We query the user for a post method.
665 (and gnus-post-method
666 (not (eq gnus-post-method 'current))
667 (listp (car gnus-post-method))))
669 ;; Collect all methods we know about.
671 (when (and gnus-post-method
672 (not (eq gnus-post-method 'current)))
673 (if (listp (car gnus-post-method))
675 (list gnus-post-method)))
676 gnus-secondary-select-methods
677 (mapcar 'cdr gnus-server-alist)
678 (mapcar 'car gnus-opened-servers)
679 (list gnus-select-method)
680 (list group-method)))
681 method-alist post-methods method)
682 ;; Weed out all mail methods.
684 (setq method (gnus-server-get-method "" (pop methods)))
685 (when (and (or (gnus-method-option-p method 'post)
686 (gnus-method-option-p method 'post-mail))
687 (not (member method post-methods)))
688 (push method post-methods)))
689 ;; Create a name-method alist.
693 (if (equal (cadr m) "")
694 (list (symbol-name (car m)) m)
695 (list (concat (cadr m) " (" (symbol-name (car m)) ")") m)))
700 (setq gnus-last-posting-server
702 gnus-last-posting-server)
703 ;; Just use the last value.
704 gnus-last-posting-server
706 "Posting method: " method-alist nil t
707 (cons (or gnus-last-posting-server "") 0))))
709 ;; Override normal method.
710 ((and (eq gnus-post-method 'current)
711 (not (eq (car group-method) 'nndraft))
712 (gnus-get-function group-method 'request-post t)
715 ((and gnus-post-method
716 (not (eq gnus-post-method 'current)))
718 ;; Use the normal select method.
719 (t gnus-select-method))))
723 (defun gnus-message-make-user-agent (&optional include-mime-info max-column)
724 "Return user-agent info.
725 INCLUDE-MIME-INFO the optional first argument if it is non-nil and the variable
726 `mime-edit-user-agent-value' exists, the return value will include it.
727 MAX-COLUMN the optional second argument if it is specified, the return value
728 will be folded up in the proper way."
729 (let ((user-agent (if (and include-mime-info
730 (boundp 'mime-edit-user-agent-value))
731 (concat (gnus-extended-version)
733 mime-edit-user-agent-value)
734 (gnus-extended-version))))
737 (unless (natnump max-column) (setq max-column 76))
739 (insert " " user-agent)
741 (while (re-search-forward "[\n\t ]+" nil t)
744 (while (re-search-forward "[^ ()/]+\\(/[^ ()/]+\\)? ?" nil t)
745 (while (eq ?\( (char-after (point)))
747 (skip-chars-forward " "))
748 (skip-chars-backward " ")
749 (if (> (current-column) max-column)
751 (if (or (not boundary) (eq ?\n (char-after boundary)))
753 (setq boundary (point))
760 (setq boundary (point))))
761 (buffer-substring 13 (point-max))))
766 ;;; Gnus Mail Functions
769 ;;; Mail reply commands of Gnus summary mode
771 (defun gnus-summary-reply (&optional yank wide)
772 "Start composing a reply mail to the current message.
773 If prefix argument YANK is non-nil, the original article is yanked
776 (list (and current-prefix-arg
777 (gnus-summary-work-articles 1))))
778 ;; Stripping headers should be specified with mail-yank-ignored-headers.
780 (gnus-summary-goto-subject (car yank)))
781 (let ((gnus-article-reply t))
782 (gnus-setup-message (if yank 'reply-yank 'reply)
783 (gnus-summary-select-article)
784 (set-buffer (gnus-copy-article-buffer))
785 (gnus-msg-treat-broken-reply-to)
786 (message-reply nil wide)
788 (gnus-inews-yank-articles yank)))))
790 (defun gnus-summary-reply-with-original (n &optional wide)
791 "Start composing a reply mail to the current message.
792 The original article will be yanked."
794 (gnus-summary-reply (gnus-summary-work-articles n) wide))
796 (defun gnus-summary-wide-reply (&optional yank)
797 "Start composing a wide reply mail to the current message.
798 If prefix argument YANK is non-nil, the original article is yanked
801 (list (and current-prefix-arg
802 (gnus-summary-work-articles 1))))
803 (gnus-summary-reply yank t))
805 (defun gnus-summary-wide-reply-with-original (n)
806 "Start composing a wide reply mail to the current message.
807 The original article will be yanked."
809 (gnus-summary-reply-with-original n t))
811 (defun gnus-summary-mail-forward (&optional full-headers post)
812 "Forward the current message to another user.
813 If FULL-HEADERS (the prefix), include full headers when forwarding."
815 (gnus-setup-message 'forward
816 (gnus-summary-select-article)
817 (let ((charset default-mime-charset))
818 (set-buffer gnus-original-article-buffer)
819 (make-local-variable 'default-mime-charset)
820 (setq default-mime-charset charset))
821 (let ((message-included-forward-headers
822 (if full-headers "" message-included-forward-headers)))
823 (message-forward post))))
825 ;;;;; XXX: generate Subject and ``Topics''?
826 ;;(defun gnus-summary-mail-digest (&optional n post)
827 ;; "Digests and forwards all articles in this series."
829 ;; (let ((subject "Digested Articles")
830 ;; (articles (gnus-summary-work-articles n))
832 ;; (gnus-setup-message 'forward
833 ;; (gnus-summary-select-article)
834 ;; (if post (message-news nil subject) (message-mail nil subject))
835 ;; (when (and message-use-multi-frames (cdr articles))
836 ;; (setq frame (window-frame (get-buffer-window (current-buffer)))))
837 ;; (message-goto-body)
838 ;; (while (setq article (pop articles))
839 ;; (save-window-excursion
840 ;; (set-buffer gnus-summary-buffer)
841 ;; (gnus-summary-select-article nil nil nil article)
842 ;; (gnus-summary-remove-process-mark article))
844 ;; (select-frame frame))
845 ;; (insert (mime-make-tag "message" "rfc822") "\n")
846 ;; (insert-buffer-substring gnus-original-article-buffer))
848 ;; (message-goto-body)
849 ;; (mime-edit-enclose-digest-region (point)(mark t)))))
851 ;;(defun gnus-summary-post-digest (&optional n)
852 ;; "Digest and forwards all articles in this series to a newsgroup."
854 ;; (gnus-summary-mail-digest n t))
856 (defun gnus-summary-resend-message (address n)
857 "Resend the current article to ADDRESS."
859 (list (message-read-from-minibuffer "Resend message(s) to: ")
861 (let ((articles (gnus-summary-work-articles n))
863 (while (setq article (pop articles))
864 (gnus-summary-select-article nil nil nil article)
866 (set-buffer gnus-original-article-buffer)
867 (message-resend address)))))
869 (defun gnus-summary-post-forward (&optional full-headers)
870 "Forward the current article to a newsgroup.
871 If FULL-HEADERS (the prefix), include full headers when forwarding."
873 (gnus-summary-mail-forward full-headers t))
875 (defvar gnus-nastygram-message
876 "The following article was inappropriately posted to %s.\n\n"
877 "Format string to insert in nastygrams.
878 The current group name will be inserted at \"%s\".")
880 (defun gnus-summary-mail-nastygram (n)
881 "Send a nastygram to the author of the current article."
883 (when (or gnus-expert-user
885 "Really send a nastygram to the author of the current article? "))
886 (let ((group gnus-newsgroup-name))
887 (gnus-summary-reply-with-original n)
888 (set-buffer gnus-message-buffer)
890 (insert (format gnus-nastygram-message group))
891 (message-send-and-exit))))
893 (defun gnus-summary-mail-crosspost-complaint (n)
894 "Send a complaint about crossposting to the current article(s)."
896 (let ((articles (gnus-summary-work-articles n))
898 (while (setq article (pop articles))
899 (set-buffer gnus-summary-buffer)
900 (gnus-summary-goto-subject article)
901 (let ((group (gnus-group-real-name gnus-newsgroup-name))
902 newsgroups followup-to)
903 (gnus-summary-select-article)
904 (set-buffer gnus-original-article-buffer)
905 (if (and (<= (length (message-tokenize-header
907 (mail-fetch-field "newsgroups"))
910 (or (not (setq followup-to (mail-fetch-field "followup-to")))
911 (not (member group (message-tokenize-header
912 followup-to ", ")))))
914 (gnus-message 1 "Followup-to restricted")
915 (gnus-message 1 "Not a crossposted article"))
916 (set-buffer gnus-summary-buffer)
917 (gnus-summary-reply-with-original 1)
918 (set-buffer gnus-message-buffer)
920 (insert (format gnus-crosspost-complaint newsgroups group))
921 (message-goto-subject)
922 (re-search-forward " *$")
923 (replace-match " (crosspost notification)" t t)
924 (gnus-deactivate-mark)
925 (when (gnus-y-or-n-p "Send this complaint? ")
926 (message-send-and-exit)))))))
928 (defun gnus-summary-mail-other-window ()
929 "Compose mail in other window."
931 (gnus-setup-message 'message
934 (defun gnus-mail-parse-comma-list ()
937 (skip-chars-forward " ")
940 (skip-chars-forward "^,")
945 (narrow-to-region beg (point))
948 (while (search-forward "\"" nil t)
952 (skip-chars-forward ",")
953 (skip-chars-forward "^,"))
954 (skip-chars-backward " ")
955 (push (buffer-substring beg (point))
957 (skip-chars-forward "^,")
958 (skip-chars-forward ", "))
961 (defun gnus-inews-add-to-address (group)
962 (let ((to-address (mail-fetch-field "to")))
963 (when (and to-address
965 ;; This mail group doesn't have a `to-list', so we add one
968 (format "Do you want to add this as `to-list': %s " to-address))
969 (gnus-group-add-parameter group (cons 'to-list to-address))))))
971 (defun gnus-put-message ()
972 "Put the current message in some group and return to Gnus."
974 (let ((reply gnus-article-reply)
975 (winconf gnus-prev-winconf)
976 (group gnus-newsgroup-name))
978 (or (and group (not (gnus-group-read-only-p group)))
979 (setq group (read-string "Put in group: " nil
980 (gnus-writable-groups))))
981 (when (gnus-gethash group gnus-newsrc-hashtb)
982 (error "No such group: %s" group))
987 (message-narrow-to-headers)
988 (let (gnus-deletable-headers)
990 (message-generate-headers message-required-news-headers)
991 (message-generate-headers message-required-mail-headers)))
992 (goto-char (point-max))
993 (insert "Gcc: " group "\n")
998 (when (get-buffer gnus-group-buffer)
999 (when (gnus-buffer-exists-p (car-safe reply))
1000 (set-buffer (car reply))
1002 (gnus-summary-mark-article-as-replied
1005 (set-window-configuration winconf)))))
1007 (defun gnus-article-mail (yank)
1008 "Send a reply to the address near point.
1009 If YANK is non-nil, include the original article."
1013 (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point)))
1014 (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point))))))
1016 (message-reply address)
1018 (gnus-inews-yank-articles (list (cdr gnus-article-current)))))))
1020 (defvar nntp-server-type)
1022 "Send a bug report to the Gnus maintainers."
1024 (unless (gnus-alive-p)
1025 (error "Gnus has been shut down"))
1026 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
1027 (unless (message-mail-user-agent)
1028 (message-pop-to-buffer "*Gnus Bug*")
1029 (delete-other-windows)
1030 (when gnus-bug-create-help-buffer
1031 (switch-to-buffer "*Gnus Help Bug*")
1033 (insert gnus-bug-message)
1034 (goto-char (point-min))
1036 (set-buffer "*Gnus Bug*")))
1037 (let ((message-this-is-mail t))
1038 (message-setup `((To . ,gnus-maintainer) (Subject . ""))))
1039 (when gnus-bug-create-help-buffer
1040 (push `(gnus-bug-kill-buffer) message-send-actions))
1041 (goto-char (point-min))
1042 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
1044 (insert gnus-product-name " " gnus-version-number
1045 " (r" gnus-revision-number ") "
1046 "based on " gnus-original-product-name " v"
1047 gnus-original-version-number "\n"
1048 (emacs-version) "\n")
1049 (when (and (boundp 'nntp-server-type)
1050 (stringp nntp-server-type))
1051 (insert nntp-server-type))
1052 (insert "\n\n\n\n\n")
1053 (let (mime-content-types)
1054 (mime-edit-insert-tag "text" "plain" "; type=emacs-lisp"))
1055 (insert (with-temp-buffer
1058 (let (mime-content-types)
1059 (mime-edit-insert-tag "text" "plain"))
1060 (goto-char (point-min))
1061 (search-forward "Subject: " nil t)
1064 (defun gnus-bug-kill-buffer ()
1065 (when (get-buffer "*Gnus Help Bug*")
1066 (kill-buffer "*Gnus Help Bug*")))
1068 (defun gnus-summary-yank-message (buffer n)
1069 "Yank the current article into a composed message."
1071 (list (completing-read "Buffer: " (mapcar 'list (message-buffers)) nil t)
1072 current-prefix-arg))
1073 (when (gnus-buffer-live-p buffer)
1074 (let ((summary-frame (selected-frame))
1075 (message-frame (when (static-if (featurep 'xemacs)
1076 (device-on-window-system-p)
1078 (let ((window (get-buffer-window buffer t)))
1080 (window-frame window)))))
1081 (separator (concat "^" (regexp-quote mail-header-separator)
1083 (gnus-summary-iterate n
1084 (gnus-summary-select-article)
1085 (gnus-copy-article-buffer)
1086 (when (frame-live-p message-frame)
1087 (raise-frame message-frame)
1088 (select-frame message-frame))
1089 (with-current-buffer buffer
1090 (when (save-excursion
1092 (let (case-fold-search)
1093 (and (not (re-search-backward separator nil t))
1094 (re-search-forward separator nil t))))
1095 (goto-char (match-end 0)))
1096 (message-yank-buffer gnus-article-copy))
1097 (select-frame summary-frame))
1098 (when (frame-live-p message-frame)
1099 (select-frame message-frame)))))
1101 (defun gnus-debug ()
1102 "Attempts to go through the Gnus source file and report what variables have been changed.
1103 The source file has to be in the Emacs load path."
1105 (let ((files '("gnus.el" "gnus-sum.el" "gnus-group.el"
1106 "gnus-art.el" "gnus-start.el" "gnus-async.el"
1107 "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el"
1108 "nnmail.el" "nntp.el" "message.el"))
1110 file expr olist sym)
1111 (gnus-message 4 "Please wait while we snoop your variables...")
1112 ;; Go through all the files looking for non-default values for variables.
1115 (set-buffer (gnus-get-buffer-create " *gnus bug info*"))
1118 (when (and (setq file (locate-library (pop files)))
1119 (file-exists-p file))
1120 (insert-file-contents file)
1121 (goto-char (point-min))
1122 (if (not (re-search-forward "^;;* *Internal variables" nil t))
1123 (gnus-message 4 "Malformed sources in file %s" file)
1124 (narrow-to-region (point-min) (point))
1125 (goto-char (point-min))
1126 (while (setq expr (ignore-errors (read (current-buffer))))
1128 (and (memq (car expr) '(defvar defcustom defvoo))
1129 (stringp (nth 3 expr))
1130 (or (not (boundp (nth 1 expr)))
1131 (not (equal (eval (nth 2 expr))
1132 (symbol-value (nth 1 expr)))))
1133 (push (nth 1 expr) olist)))))))
1134 (kill-buffer (current-buffer)))
1135 (when (setq olist (nreverse olist))
1136 (insert ";----------------- Environment follows ------------------\n\n"))
1138 (if (boundp (car olist))
1140 (pp `(setq ,(car olist)
1141 ,(if (or (consp (setq sym (symbol-value (car olist))))
1143 (not (or (eq sym nil)
1145 (list 'quote (symbol-value (car olist)))
1146 (symbol-value (car olist))))
1149 (format "(setq %s 'whatever)\n" (car olist))))
1150 (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
1151 (setq olist (cdr olist)))
1152 ;; Remove any control chars - they seem to cause trouble for some
1153 ;; mailers. (Byte-compiled output from the stuff above.)
1155 (while (re-search-forward "[\000-\010\013-\037\200-\237]" nil t)
1156 (replace-match (format "\\%03o" (string-to-char (match-string 0)))
1158 ;; Break MIME tags purposely.
1160 (while (re-search-forward mime-edit-tag-regexp nil t)
1161 (goto-char (1+ (match-beginning 0)))
1164 ;;; Treatment of rejected articles.
1167 (defun gnus-summary-resend-bounced-mail (&optional fetch)
1168 "Re-mail the current message.
1169 This only makes sense if the current message is a bounce message than
1170 contains some mail you have written which has been bounced back to
1172 If FETCH, try to fetch the article that this is a reply to, if indeed
1175 (gnus-summary-select-article t)
1176 (set-buffer gnus-original-article-buffer)
1177 (let ((gnus-message-setup-hook '(gnus-maybe-setup-default-charset)))
1178 (gnus-setup-message 'compose-bounce
1179 (let* ((references (mail-fetch-field "references"))
1180 (parent (and references (gnus-parent-id references))))
1182 ;; If there are references, we fetch the article we answered to.
1184 (gnus-summary-refer-article parent)
1185 (gnus-summary-show-all-headers))))))
1189 (defun gnus-inews-group-method (group)
1190 (cond ((and (null (gnus-get-info group))
1191 (eq (car gnus-message-archive-method)
1193 (gnus-server-to-method
1194 (gnus-group-method group)))))
1195 ;; If the group doesn't exist, we assume
1196 ;; it's an archive group...
1197 gnus-message-archive-method)
1199 ((gnus-info-method (gnus-get-info group))
1200 (gnus-info-method (gnus-get-info group)))
1202 (t (gnus-group-method group))))
1204 ;; Do Gcc handling, which copied the message over to some group.
1205 (defun gnus-inews-do-gcc (&optional gcc)
1207 (when (gnus-alive-p)
1210 (message-narrow-to-headers)
1211 (let ((gcc (or gcc (mail-fetch-field "gcc" nil t)))
1212 (coding-system-for-write 'raw-text)
1213 (output-coding-system 'raw-text)
1214 groups group method group-art)
1216 (message-remove-header "gcc")
1218 (setq groups (message-unquote-tokens
1219 (message-tokenize-header gcc " ,")))
1220 ;; Copy the article over to some group(s).
1221 (while (setq group (pop groups))
1223 (setq method (gnus-inews-group-method group)))
1224 (unless (gnus-request-group group t method)
1225 (gnus-request-create-group group method))
1227 (nnheader-set-temp-buffer " *acc*")
1228 (insert-buffer-substring message-encoding-buffer)
1229 (gnus-run-hooks 'gnus-before-do-gcc-hook)
1230 (goto-char (point-min))
1231 (when (re-search-forward
1232 (concat "^" (regexp-quote mail-header-separator) "$")
1234 (replace-match "" t t ))
1235 (unless (setq group-art
1236 (gnus-request-accept-article group method t t))
1237 (gnus-message 1 "Couldn't store article in group %s: %s"
1238 group (gnus-status-message method))
1240 (when (and group-art gnus-inews-mark-gcc-as-read)
1241 (let ((active (gnus-active group)))
1243 (if (< (cdr active) (cdr group-art))
1244 (gnus-set-active group (cons (car active)
1246 (gnus-activate-group group)))
1247 (let ((buffer (gnus-summary-buffer-name group))
1248 (mark gnus-read-mark)
1249 (article (cdr group-art)))
1253 (with-current-buffer buffer
1254 (when gnus-newsgroup-prepared
1255 (when (and gnus-newsgroup-auto-expire
1256 (memq mark gnus-auto-expirable-marks))
1257 (setq mark gnus-expirable-mark))
1258 (setq mark (gnus-request-update-mark
1259 group article mark))
1260 (gnus-mark-article-as-read article mark)
1261 (setq gnus-newsgroup-active (gnus-active group))
1263 (gnus-group-make-articles-read group
1265 (when (gnus-group-auto-expirable-p group)
1266 (gnus-add-marked-articles
1267 group 'expire (list article))))))
1268 (kill-buffer (current-buffer))))))))))
1270 (defun gnus-inews-insert-gcc ()
1271 "Insert Gcc headers based on `gnus-outgoing-message-group'."
1274 (message-narrow-to-headers)
1275 (let* ((group gnus-outgoing-message-group)
1277 ((gnus-functionp group)
1279 ((or (stringp group) (list group))
1283 (if (stringp gcc) gcc
1284 (mapconcat 'identity gcc " "))
1287 (defun gnus-inews-insert-archive-gcc (&optional group)
1288 "Insert the Gcc to say where the article is to be archived."
1289 (let* ((var gnus-message-archive-group)
1290 (group (or group gnus-newsgroup-name ""))
1292 (and gnus-newsgroup-name
1293 (not (equal gnus-newsgroup-name ""))
1294 (gnus-group-find-parameter
1295 gnus-newsgroup-name 'gcc-self)))
1299 ((null gnus-message-archive-method)
1303 ;; Just a single group.
1306 ;; We don't want this.
1308 ((and (listp var) (stringp (car var)))
1309 ;; A list of groups.
1311 ((gnus-functionp var)
1313 (funcall var group))
1315 ;; An alist of regexps/functions/forms.
1320 ((stringp (caar var))
1322 (when (string-match (caar var) group)
1324 ((gnus-functionp (car var))
1326 (funcall (car var) group))
1328 (eval (car var)))))))
1329 (setq var (cdr var)))
1332 (when (or groups gcc-self-val)
1333 (when (stringp groups)
1334 (setq groups (list groups)))
1337 (message-narrow-to-headers)
1338 (goto-char (point-max))
1341 ;; Use the `gcc-self' param value instead.
1344 (if (stringp gcc-self-val)
1347 (if (not (eq gcc-self-val 'none))
1352 ;; Use the list of groups.
1353 (while (setq name (pop groups))
1354 (insert (if (string-match ":" name)
1356 (gnus-group-prefixed-name
1357 name gnus-message-archive-method)))
1364 (defun gnus-configure-posting-styles ()
1365 "Configure posting styles according to `gnus-posting-styles'."
1366 (unless gnus-inhibit-posting-styles
1367 (let ((group (or gnus-newsgroup-name ""))
1368 (styles gnus-posting-styles)
1369 style match variable attribute value v results
1370 filep name address element)
1371 ;; If the group has a posting-style parameter, add it at the end with a
1372 ;; regexp matching everything, to be sure it takes precedence over all
1374 (when gnus-newsgroup-name
1375 (let ((tmp-style (gnus-group-find-parameter group 'posting-style t)))
1377 (setq styles (append styles (list (cons ".*" tmp-style)))))))
1378 ;; Go through all styles and look for matches.
1379 (dolist (style styles)
1380 (setq match (pop style))
1381 (goto-char (point-min))
1384 ;; Regexp string match on the group name.
1385 (string-match match group))
1387 (and (gnus-buffer-live-p gnus-article-copy)
1388 (with-current-buffer gnus-article-copy
1389 (let ((header (message-fetch-field (pop style))))
1391 (string-match (pop style) header))))))
1392 ((or (symbolp match)
1393 (gnus-functionp match))
1395 ((gnus-functionp match)
1396 ;; Function to be called.
1399 ;; Variable to be checked.
1400 (symbol-value match))))
1402 ;; This is a form to be evaled.
1404 ;; We have a match, so we set the variables.
1405 (dolist (attribute style)
1406 (setq element (pop attribute)
1411 ((eq (car attribute) ':file)
1414 ((eq (car attribute) :value)
1418 ;; We get the value.
1423 ((or (symbolp value)
1424 (gnus-functionp value))
1425 (cond ((gnus-functionp value)
1428 (symbol-value value))))
1431 ;; Translate obsolescent value.
1432 (when (eq element 'signature-file)
1433 (setq element 'signature
1435 ;; Get the contents of file elems.
1437 (setq v (with-temp-buffer
1438 (insert-file-contents v)
1440 (setq results (delq (assoc element results) results))
1441 (push (cons element v) results))))
1442 ;; Now we have all the styles, so we insert them.
1443 (setq name (assq 'name results)
1444 address (assq 'address results))
1445 (setq results (delq name (delq address results)))
1446 (make-local-variable 'message-setup-hook)
1447 (dolist (result results)
1448 (add-hook 'message-setup-hook
1450 ((eq 'eval (car result))
1452 ((eq 'body (car result))
1456 (insert ,(cdr result)))))
1457 ((eq 'signature (car result))
1458 (set (make-local-variable 'message-signature) nil)
1459 (set (make-local-variable 'message-signature-file) nil)
1460 (if (not (cdr result))
1464 (let ((message-signature ,(cdr result)))
1465 (when message-signature
1466 (message-insert-signature)))))))
1469 (if (symbolp (car result))
1470 (capitalize (symbol-name (car result)))
1474 (message-remove-header ,header)
1475 (let ((value ,(cdr result)))
1478 (insert ,header ": " value "\n"))))))))))
1479 (when (or name address)
1480 (add-hook 'message-setup-hook
1482 (set (make-local-variable 'user-mail-address)
1483 ,(or (cdr address) user-mail-address))
1484 (let ((user-full-name ,(or (cdr name) (user-full-name)))
1486 ,(or (cdr address) user-mail-address)))
1488 (message-remove-header "From")
1490 (insert "From: " (message-make-from) "\n")))))))))
1493 ;;; @ for MIME Edit mode
1496 (defun gnus-maybe-setup-default-charset ()
1498 (and (boundp 'gnus-summary-buffer)
1499 (buffer-live-p gnus-summary-buffer)
1501 (set-buffer gnus-summary-buffer)
1502 default-mime-charset))))
1505 (make-local-variable 'default-mime-charset)
1506 (setq default-mime-charset charset)
1510 ;;; @ for MIME view mode
1513 (defun gnus-following-method (buf)
1514 (gnus-setup-message 'reply-yank
1516 (if (message-news-p)
1518 (message-reply nil 'wide))
1519 (let ((message-reply-buffer buf))
1520 (message-yank-original))
1521 (message-goto-body))
1525 ;;; Allow redefinition of functions.
1531 ;;; gnus-msg.el ends here