* (gnus-inews-yank-articles): Reselect the message frame after selecting a new
[elisp/gnus.git-] / lisp / gnus-msg.el
1 ;;; gnus-msg.el --- mail and post interface for Semi-gnus
2 ;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc.
3
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
5 ;;      Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;;      MORIOKA Tomohiko <morioka@jaist.ac.jp>
7 ;;      Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
8 ;;      Katsumi Yamaoka  <yamaoka@jpl.org>
9 ;; Keywords: mail, news, MIME
10
11 ;; This file is part of GNU Emacs.
12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; any later version.
17
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ;; GNU General Public License for more details.
22
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
27
28 ;;; Commentary:
29
30 ;;; Code:
31
32 (eval-when-compile (require 'cl))
33
34 (require 'gnus)
35 (require 'gnus-ems)
36 (require 'message)
37 (require 'gnus-art)
38
39 (defcustom gnus-post-method nil
40   "*Preferred method for posting USENET news.
41
42 If this variable is `current', Gnus will use the \"current\" select
43 method when posting.  If it is nil (which is the default), Gnus will
44 use the native posting method of the server.
45
46 This method will not be used in mail groups and the like, only in
47 \"real\" newsgroups.
48
49 If not nil nor `native', the value must be a valid method as discussed
50 in the documentation of `gnus-select-method'. It can also be a list of
51 methods. If that is the case, the user will be queried for what select
52 method to use when posting."
53   :group 'gnus-group-foreign
54   :type `(choice (const nil)
55                  (const current)
56                  (const native)
57                  (sexp :tag "Methods" ,gnus-select-method)))
58
59 (defvar gnus-outgoing-message-group nil
60   "*All outgoing messages will be put in this group.
61 If you want to store all your outgoing mail and articles in the group
62 \"nnml:archive\", you set this variable to that value.  This variable
63 can also be a list of group names.
64
65 If you want to have greater control over what group to put each
66 message in, you can set this variable to a function that checks the
67 current newsgroup name and then returns a suitable group name (or list
68 of names).")
69
70 (defvar gnus-mailing-list-groups nil
71   "*Regexp matching groups that are really mailing lists.
72 This is useful when you're reading a mailing list that has been
73 gatewayed to a newsgroup, and you want to followup to an article in
74 the group.")
75
76 (defvar gnus-add-to-list nil
77   "*If non-nil, add a `to-list' parameter automatically.")
78
79 (defvar gnus-crosspost-complaint
80   "Hi,
81
82 You posted the article below with the following Newsgroups header:
83
84 Newsgroups: %s
85
86 The %s group, at least, was an inappropriate recipient
87 of this message.  Please trim your Newsgroups header to exclude this
88 group before posting in the future.
89
90 Thank you.
91
92 "
93   "Format string to be inserted when complaining about crossposts.
94 The first %s will be replaced by the Newsgroups header;
95 the second with the current group name.")
96
97 (defvar gnus-message-setup-hook '(gnus-maybe-setup-default-charset)
98   "Hook run after setting up a message buffer.")
99
100 (defvar gnus-bug-create-help-buffer t
101   "*Should we create the *Gnus Help Bug* buffer?")
102
103 (defvar gnus-posting-styles nil
104   "*Alist of styles to use when posting.")
105
106 (defvar gnus-posting-style-alist
107   '((organization . message-user-organization)
108     (signature . message-signature)
109     (signature-file . message-signature-file)
110     (address . user-mail-address)
111     (name . user-full-name))
112   "*Mapping from style parameters to variables.")
113
114 (defcustom gnus-group-posting-charset-alist
115   '(("^no\\." iso-8859-1)
116     (".*" iso-8859-1)
117     (message-this-is-news iso-8859-1)
118     (message-this-is-mail nil)
119     )
120   "Alist of regexps (to match group names) and default charsets to be unencoded when posting."
121   :type '(repeat (list (regexp :tag "Group")
122                        (symbol :tag "Charset")))
123   :group 'gnus-charset)
124
125 ;;; Internal variables.
126
127 (defvar gnus-inhibit-posting-styles nil
128   "Inhibit the use of posting styles.")
129
130 (defvar gnus-message-buffer "*Mail Gnus*")
131 (defvar gnus-article-copy nil)
132 (defvar gnus-last-posting-server nil)
133 (defvar gnus-message-group-art nil)
134
135 (defconst gnus-bug-message
136   (format "Sending a bug report to the Gnus Towers.
137 ========================================
138
139 This gnus is the %s%s.
140 If you think the bug is a Semi-gnus bug, send a bug report to Semi-gnus
141 Developers. (the addresses below are mailing list addresses)
142
143 ========================================
144
145 The buffer below is a mail buffer.  When you press `C-c C-c', it will
146 be sent to the Gnus Bug Exterminators.
147
148 At the bottom of the buffer you'll see lots of variable settings.
149 Please do not delete those.  They will tell the Bug People what your
150 environment is, so that it will be easier to locate the bugs.
151
152 If you have found a bug that makes Emacs go \"beep\", set
153 debug-on-error to t (`M-x set-variable RET debug-on-error RET t RET')
154 and include the backtrace in your bug report.
155
156 Please describe the bug in annoying, painstaking detail.
157
158 Thank you for your help in stamping out bugs.
159 "
160           gnus-product-name
161           (if (string= gnus-product-name "Semi-gnus")
162               ""
163             ", a modified version of Semi-gnus")))
164
165 (eval-and-compile
166   (autoload 'gnus-uu-post-news "gnus-uu" nil t)
167   (autoload 'news-setup "rnewspost")
168   (autoload 'news-reply-mode "rnewspost")
169   (autoload 'rmail-dont-reply-to "mail-utils")
170   (autoload 'rmail-output "rmailout"))
171
172 \f
173 ;;;
174 ;;; Gnus Posting Functions
175 ;;;
176
177 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map)
178   "p" gnus-summary-post-news
179   "f" gnus-summary-followup
180   "F" gnus-summary-followup-with-original
181   "c" gnus-summary-cancel-article
182   "s" gnus-summary-supersede-article
183   "r" gnus-summary-reply
184   "R" gnus-summary-reply-with-original
185   "w" gnus-summary-wide-reply
186   "W" gnus-summary-wide-reply-with-original
187   "n" gnus-summary-followup-to-mail
188   "N" gnus-summary-followup-to-mail-with-original
189   "m" gnus-summary-mail-other-window
190   "u" gnus-uu-post-news
191   "\M-c" gnus-summary-mail-crosspost-complaint
192   "om" gnus-summary-mail-forward
193   "op" gnus-summary-post-forward
194   "Om" gnus-summary-mail-digest
195   "Op" gnus-summary-post-digest)
196
197 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
198   "b" gnus-summary-resend-bounced-mail
199   ;; "c" gnus-summary-send-draft
200   "r" gnus-summary-resend-message)
201
202 ;;; Internal functions.
203
204 (defvar gnus-article-reply nil)
205 (defmacro gnus-setup-message (config &rest forms)
206   (let ((winconf (make-symbol "gnus-setup-message-winconf"))
207         (buffer (make-symbol "gnus-setup-message-buffer"))
208         (article (make-symbol "gnus-setup-message-article"))
209         (group (make-symbol "gnus-setup-message-group")))
210     `(let ((,winconf (current-window-configuration))
211            (,buffer (buffer-name (current-buffer)))
212            (,article (and gnus-article-reply (gnus-summary-article-number)))
213            (,group gnus-newsgroup-name)
214            (message-header-setup-hook
215             (copy-sequence message-header-setup-hook))
216            (message-mode-hook (copy-sequence message-mode-hook))
217            (message-startup-parameter-alist
218             '((reply-buffer . gnus-copy-article-buffer)
219               (original-buffer . gnus-original-article-buffer)
220               (user-agent . Gnus))))
221        (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
222        (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
223        (add-hook 'message-mode-hook 'gnus-configure-posting-styles)
224        (unwind-protect
225            (progn
226              ,@forms)
227          (gnus-inews-add-send-actions ,winconf ,buffer ,article)
228          (setq gnus-message-buffer (current-buffer))
229          (set (make-local-variable 'gnus-message-group-art)
230               (cons ,group ,article))
231          (set (make-local-variable 'gnus-newsgroup-name) ,group)
232          (set (make-local-variable 'message-posting-charset)
233               (gnus-setup-posting-charset ,group))
234          (gnus-run-hooks 'gnus-message-setup-hook))
235        (gnus-add-buffer)
236        (gnus-configure-windows ,config t)
237        (set-buffer-modified-p nil))))
238
239 (defun gnus-setup-posting-charset (group)
240   (let ((alist gnus-group-posting-charset-alist)
241         elem)
242     (catch 'found
243       (while (setq elem (pop alist))
244         (when (or (and (stringp (car elem))
245                        (string-match (car elem) group))
246                   (and (gnus-functionp (car elem))
247                        (funcall (car elem) group))
248                   (and (symbolp (car elem))
249                        (symbol-value (car elem))))
250           (throw 'found (cadr elem)))))))
251
252 (defun gnus-inews-add-send-actions (winconf buffer article)
253   (make-local-hook 'message-sent-hook)
254   (add-hook 'message-sent-hook 'gnus-inews-do-gcc nil t)
255   (setq message-post-method
256         `(lambda (arg)
257            (gnus-post-method arg ,gnus-newsgroup-name)))
258   (setq message-user-agent (gnus-extended-version))
259   (when (not message-use-multi-frames)
260     (message-add-action
261      `(set-window-configuration ,winconf) 'exit 'postpone 'kill))
262   (message-add-action
263    `(when (gnus-buffer-exists-p ,buffer)
264       (save-excursion
265         (set-buffer ,buffer)
266         ,(when article
267            `(gnus-summary-mark-article-as-replied ,article))))
268    'send))
269
270 (put 'gnus-setup-message 'lisp-indent-function 1)
271 (put 'gnus-setup-message 'edebug-form-spec '(form body))
272
273 ;;; Post news commands of Gnus group mode and summary mode
274
275 (defun gnus-group-mail (&optional arg)
276   "Start composing a mail.
277 If ARG, use the group under the point to find a posting style.
278 If ARG is 1, prompt for a group name to find the posting style."
279   (interactive "P")
280   ;; We can't `let' gnus-newsgroup-name here, since that leads
281   ;; to local variables leaking.
282   (let ((group gnus-newsgroup-name)
283         (buffer (current-buffer)))
284     (unwind-protect
285         (progn
286           (setq gnus-newsgroup-name
287                 (if arg
288                     (if (= 1 (prefix-numeric-value arg))
289                         (completing-read "Use posting style of group: "
290                                          gnus-active-hashtb nil
291                                          (gnus-read-active-file-p))
292                       (gnus-group-group-name))
293                   ""))
294           (gnus-setup-message 'message (message-mail)))
295       (save-excursion
296         (set-buffer buffer)
297         (setq gnus-newsgroup-name group)))))
298
299 (defun gnus-group-post-news (&optional arg)
300   "Start composing a news message.
301 If ARG, post to the group under point.
302 If ARG is 1, prompt for a group name."
303   (interactive "P")
304   ;; Bind this variable here to make message mode hooks work ok.
305   (let ((gnus-newsgroup-name
306          (if arg
307              (if (= 1 (prefix-numeric-value arg))
308                  (completing-read "Newsgroup: " gnus-active-hashtb nil
309                                   (gnus-read-active-file-p))
310                (gnus-group-group-name))
311            "")))
312     (gnus-post-news 'post gnus-newsgroup-name)))
313
314 (defun gnus-summary-post-news ()
315   "Start composing a news message."
316   (interactive)
317   (gnus-post-news 'post gnus-newsgroup-name))
318
319 (defun gnus-summary-followup (yank &optional force-news)
320   "Compose a followup to an article.
321 If prefix argument YANK is non-nil, original article is yanked automatically."
322   (interactive
323    (list (and current-prefix-arg
324               (gnus-summary-work-articles 1))))
325   (when yank
326     (gnus-summary-goto-subject (car yank)))
327   (save-window-excursion
328     (gnus-summary-select-article))
329   (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
330         (gnus-newsgroup-name gnus-newsgroup-name))
331     ;; Send a followup.
332     (gnus-post-news nil gnus-newsgroup-name
333                     headers gnus-article-buffer
334                     yank nil force-news)))
335
336 (defun gnus-summary-followup-with-original (n &optional force-news)
337   "Compose a followup to an article and include the original article."
338   (interactive "P")
339   (gnus-summary-followup (gnus-summary-work-articles n) force-news))
340
341 (defun gnus-summary-followup-to-mail (&optional arg)
342   "Followup to the current mail message via news."
343   (interactive
344    (list (and current-prefix-arg
345               (gnus-summary-work-articles 1))))
346   (gnus-summary-followup arg t))
347
348 (defun gnus-summary-followup-to-mail-with-original (&optional arg)
349   "Followup to the current mail message via news."
350   (interactive "P")
351   (gnus-summary-followup (gnus-summary-work-articles arg) t))
352
353 (defun gnus-inews-yank-articles (articles)
354   (let ((frame (when (and message-use-multi-frames
355                           (> (length articles) 1))
356                  (window-frame (get-buffer-window (current-buffer)))))
357         beg article)
358     (message-goto-body)
359     (while (setq article (pop articles))
360       (save-window-excursion
361         (set-buffer gnus-summary-buffer)
362         (gnus-summary-select-article nil nil nil article)
363         (gnus-summary-remove-process-mark article))
364       (when frame
365         (select-frame frame))
366       (gnus-copy-article-buffer)
367       (let ((message-reply-buffer gnus-article-copy)
368             (message-reply-headers gnus-current-headers))
369         (message-yank-original)
370         (setq beg (or beg (mark t))))
371       (when articles
372         (insert "\n")))
373     (push-mark)
374     (goto-char beg)))
375
376 (defun gnus-summary-cancel-article (&optional n symp)
377   "Cancel an article you posted.
378 Uses the process-prefix convention.  If given the symbolic
379 prefix `a', cancel using the standard posting method; if not
380 post using the current select method."
381   (interactive (gnus-interactive "P\ny"))
382   (let ((articles (gnus-summary-work-articles n))
383         (message-post-method
384          `(lambda (arg)
385             (gnus-post-method (not (eq symp 'a)) ,gnus-newsgroup-name)))
386         article)
387     (while (setq article (pop articles))
388       (when (gnus-summary-select-article t nil nil article)
389         (when (gnus-eval-in-buffer-window gnus-article-buffer
390                 (save-excursion
391                   (set-buffer gnus-original-article-buffer)
392                   (message-cancel-news)))
393           (gnus-summary-mark-as-read article gnus-canceled-mark)
394           (gnus-cache-remove-article 1))
395         (gnus-article-hide-headers-if-wanted))
396       (gnus-summary-remove-process-mark article))))
397
398 (defun gnus-summary-supersede-article ()
399   "Compose an article that will supersede a previous article.
400 This is done simply by taking the old article and adding a Supersedes
401 header line with the old Message-ID."
402   (interactive)
403   (let ((article (gnus-summary-article-number))
404         (gnus-message-setup-hook '(gnus-maybe-setup-default-charset)))
405     (gnus-setup-message 'reply-yank
406       (gnus-summary-select-article t)
407       (set-buffer gnus-original-article-buffer)
408       (message-supersede)
409       (push
410        `((lambda ()
411            (when (gnus-buffer-exists-p ,gnus-summary-buffer)
412              (save-excursion
413                (set-buffer ,gnus-summary-buffer)
414                (gnus-cache-possibly-remove-article ,article nil nil nil t)
415                (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
416        message-send-actions))))
417
418 \f
419
420 (defun gnus-copy-article-buffer (&optional article-buffer)
421   ;; make a copy of the article buffer with all text properties removed
422   ;; this copy is in the buffer gnus-article-copy.
423   ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
424   ;; this buffer should be passed to all mail/news reply/post routines.
425   (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*"))
426   (let ((article-buffer (or article-buffer gnus-article-buffer))
427         end beg)
428     (if (not (and (get-buffer article-buffer)
429                   (gnus-buffer-exists-p article-buffer)))
430         (error "Can't find any article buffer")
431       (save-excursion
432         (set-buffer article-buffer)
433         (save-restriction
434           ;; Copy over the (displayed) article buffer, delete
435           ;; hidden text and remove text properties.
436           (widen)
437           (copy-to-buffer gnus-article-copy (point-min) (point-max))
438           (set-buffer gnus-article-copy)
439           (gnus-article-delete-text-of-type 'annotation)
440           (gnus-remove-text-with-property 'gnus-prev)
441           (gnus-remove-text-with-property 'gnus-next)
442           (insert
443            (prog1
444                (format "%s" (buffer-string))
445              (erase-buffer)))
446           ;; Find the original headers.
447           (set-buffer gnus-original-article-buffer)
448           (goto-char (point-min))
449           (while (looking-at message-unix-mail-delimiter)
450             (forward-line 1))
451           (setq beg (point))
452           (setq end (or (search-forward "\n\n" nil t) (point)))
453           ;; Delete the headers from the displayed articles.
454           (set-buffer gnus-article-copy)
455           (delete-region (goto-char (point-min))
456                          (or (search-forward "\n\n" nil t) (point-max)))
457           ;; Insert the original article headers.
458           (insert-buffer-substring gnus-original-article-buffer beg end)
459           (article-decode-encoded-words)))
460       gnus-article-copy)))
461
462 (defun gnus-post-news (post &optional group header article-buffer yank subject
463                             force-news)
464   (when article-buffer
465     (gnus-copy-article-buffer))
466   (let ((gnus-article-reply article-buffer)
467         (add-to-list gnus-add-to-list))
468     (gnus-setup-message (cond (yank 'reply-yank)
469                               (article-buffer 'reply)
470                               (t 'message))
471       (let* ((group (or group gnus-newsgroup-name))
472              (pgroup group)
473              to-address to-group mailing-list to-list
474              newsgroup-p)
475         (when group
476           (setq to-address (gnus-group-find-parameter group 'to-address)
477                 to-group (gnus-group-find-parameter group 'to-group)
478                 to-list (gnus-group-find-parameter group 'to-list)
479                 newsgroup-p (gnus-group-find-parameter group 'newsgroup)
480                 mailing-list (when gnus-mailing-list-groups
481                                (string-match gnus-mailing-list-groups group))
482                 group (gnus-group-real-name group)))
483         (if (or (and to-group
484                      (gnus-news-group-p to-group))
485                 newsgroup-p
486                 force-news
487                 (and (gnus-news-group-p
488                       (or pgroup gnus-newsgroup-name)
489                       (if header (mail-header-number header)
490                         gnus-current-article))
491                      (not mailing-list)
492                      (not to-list)
493                      (not to-address)))
494             ;; This is news.
495             (if post
496                 (message-news (or to-group group))
497               (set-buffer gnus-article-copy)
498               (gnus-msg-treat-broken-reply-to)
499               (message-followup (if (or newsgroup-p force-news) nil to-group)))
500           ;; The is mail.
501           (if post
502               (progn
503                 (message-mail (or to-address to-list))
504                 ;; Arrange for mail groups that have no `to-address' to
505                 ;; get that when the user sends off the mail.
506                 (when (and (not to-list)
507                            (not to-address)
508                            add-to-list)
509                   (push (list 'gnus-inews-add-to-address pgroup)
510                         message-send-actions)))
511             (set-buffer gnus-article-copy)
512             (gnus-msg-treat-broken-reply-to)
513             (message-wide-reply to-address)))
514         (when yank
515           (gnus-inews-yank-articles yank))))))
516
517 (defun gnus-msg-treat-broken-reply-to ()
518   "Remove the Reply-to header iff broken-reply-to."
519   (when (gnus-group-find-parameter
520          gnus-newsgroup-name 'broken-reply-to)
521     (save-restriction
522       (message-narrow-to-head)
523       (message-remove-header "reply-to"))))
524
525 (defun gnus-post-method (arg group &optional silent)
526   "Return the posting method based on GROUP and ARG.
527 If SILENT, don't prompt the user."
528   (let ((group-method (gnus-find-method-for-group group)))
529     (cond
530      ;; If the group-method is nil (which shouldn't happen) we use
531      ;; the default method.
532      ((null group-method)
533       (or (and (null (eq gnus-post-method 'active)) gnus-post-method)
534                gnus-select-method message-post-method))
535      ;; We want the inverse of the default
536      ((and arg (not (eq arg 0)))
537       (if (eq gnus-post-method 'active)
538           gnus-select-method
539         group-method))
540      ;; We query the user for a post method.
541      ((or arg
542           (and gnus-post-method
543                (not (eq gnus-post-method 'current))
544                (listp (car gnus-post-method))))
545       (let* ((methods
546               ;; Collect all methods we know about.
547               (append
548                (when (and gnus-post-method
549                           (not (eq gnus-post-method 'current)))
550                  (if (listp (car gnus-post-method))
551                      gnus-post-method
552                    (list gnus-post-method)))
553                gnus-secondary-select-methods
554                (mapcar 'cdr gnus-server-alist)
555                (mapcar 'car gnus-opened-servers)
556                (list gnus-select-method)
557                (list group-method)))
558              method-alist post-methods method)
559         ;; Weed out all mail methods.
560         (while methods
561           (setq method (gnus-server-get-method "" (pop methods)))
562           (when (and (or (gnus-method-option-p method 'post)
563                          (gnus-method-option-p method 'post-mail))
564                      (not (member method post-methods)))
565             (push method post-methods)))
566         ;; Create a name-method alist.
567         (setq method-alist
568               (mapcar
569                (lambda (m)
570                  (list (concat (cadr m) " (" (symbol-name (car m)) ")") m))
571                post-methods))
572         ;; Query the user.
573         (cadr
574          (assoc
575           (setq gnus-last-posting-server
576                 (if (and silent
577                          gnus-last-posting-server)
578                     ;; Just use the last value.
579                     gnus-last-posting-server
580                   (completing-read
581                    "Posting method: " method-alist nil t
582                    (cons (or gnus-last-posting-server "") 0))))
583           method-alist))))
584      ;; Override normal method.
585      ((and (eq gnus-post-method 'current)
586            (not (eq (car group-method) 'nndraft))
587            (not arg))
588       group-method)
589      ((and gnus-post-method
590            (not (eq gnus-post-method 'current)))
591       gnus-post-method)
592      ;; Use the normal select method.
593      (t gnus-select-method))))
594
595 \f
596
597 (defun gnus-extended-version ()
598   "Stringified gnus version."
599   (concat gnus-product-name "/" gnus-version-number " (based on "
600           gnus-original-product-name " v" gnus-original-version-number ")"))
601
602 (defun gnus-message-make-user-agent (&optional include-mime-info max-column)
603   "Return user-agent info.
604 INCLUDE-MIME-INFO the optional first argument if it is non-nil and the variable
605   `mime-edit-user-agent-value' exists, the return value will include it.
606 MAX-COLUMN the optional second argument if it is specified, the return value
607   will be folded up in the proper way."
608   (let ((user-agent (if (and include-mime-info
609                              (boundp 'mime-edit-user-agent-value))
610                         (concat (gnus-extended-version)
611                                 " "
612                                 mime-edit-user-agent-value)
613                       (gnus-extended-version))))
614     (if max-column
615         (let (boundary)
616           (unless (natnump max-column) (setq max-column 76))
617           (with-temp-buffer
618             (insert "            " user-agent)
619             (goto-char 13)
620             (while (re-search-forward "[\n\t ]+" nil t)
621               (replace-match " "))
622             (goto-char 13)
623             (while (re-search-forward "[^ ()/]+\\(/[^ ()/]+\\)? ?" nil t)
624               (while (eq ?\( (char-after (point)))
625                 (forward-list)
626                 (skip-chars-forward " "))
627               (skip-chars-backward " ")
628               (if (> (current-column) max-column)
629                   (progn
630                     (if (or (not boundary) (eq ?\n (char-after boundary)))
631                         (progn
632                           (setq boundary (point))
633                           (unless (eobp)
634                             (delete-char 1)
635                             (insert "\n ")))
636                       (goto-char boundary)
637                       (delete-char 1)
638                       (insert "\n ")))
639                 (setq boundary (point))))
640             (buffer-substring 13 (point-max))))
641       user-agent)))
642
643 \f
644 ;;;
645 ;;; Gnus Mail Functions
646 ;;;
647
648 ;;; Mail reply commands of Gnus summary mode
649
650 (defun gnus-summary-reply (&optional yank wide)
651   "Start composing a reply mail to the current message.
652 If prefix argument YANK is non-nil, the original article is yanked
653 automatically."
654   (interactive
655    (list (and current-prefix-arg
656               (gnus-summary-work-articles 1))))
657   ;; Stripping headers should be specified with mail-yank-ignored-headers.
658   (when yank
659     (gnus-summary-goto-subject (car yank)))
660   (let ((gnus-article-reply t))
661     (gnus-setup-message (if yank 'reply-yank 'reply)
662       (gnus-summary-select-article)
663       (set-buffer (gnus-copy-article-buffer))
664       (gnus-msg-treat-broken-reply-to)
665       (message-reply nil wide)
666       (when yank
667         (gnus-inews-yank-articles yank)))))
668
669 (defun gnus-summary-reply-with-original (n &optional wide)
670   "Start composing a reply mail to the current message.
671 The original article will be yanked."
672   (interactive "P")
673   (gnus-summary-reply (gnus-summary-work-articles n) wide))
674
675 (defun gnus-summary-wide-reply (&optional yank)
676   "Start composing a wide reply mail to the current message.
677 If prefix argument YANK is non-nil, the original article is yanked
678 automatically."
679   (interactive
680    (list (and current-prefix-arg
681               (gnus-summary-work-articles 1))))
682   (gnus-summary-reply yank t))
683
684 (defun gnus-summary-wide-reply-with-original (n)
685   "Start composing a wide reply mail to the current message.
686 The original article will be yanked."
687   (interactive "P")
688   (gnus-summary-reply-with-original n t))
689
690 (defun gnus-summary-mail-forward (&optional full-headers post)
691   "Forward the current message to another user.
692 If FULL-HEADERS (the prefix), include full headers when forwarding."
693   (interactive "P")
694   (gnus-setup-message 'forward
695     (gnus-summary-select-article)
696     (let ((charset default-mime-charset))
697       (set-buffer gnus-original-article-buffer)
698       (make-local-variable 'default-mime-charset)
699       (setq default-mime-charset charset)
700       )
701     (let ((message-included-forward-headers
702            (if full-headers "" message-included-forward-headers)))
703       (message-forward post))))
704
705 ;;; XXX: generate Subject and ``Topics''?
706 (defun gnus-summary-mail-digest (&optional n post)
707   "Digests and forwards all articles in this series."
708   (interactive "P")
709   (let ((subject "Digested Articles")
710         (articles (gnus-summary-work-articles n))
711         article)
712     (gnus-setup-message 'forward
713       (gnus-summary-select-article)
714       (if post (message-news nil subject) (message-mail nil subject))
715       (message-goto-body)
716       (while (setq article (pop articles))
717         (save-window-excursion
718           (set-buffer gnus-summary-buffer)
719           (gnus-summary-select-article nil nil nil article)
720           (gnus-summary-remove-process-mark article))
721         (insert (mime-make-tag "message" "rfc822") "\n")
722         (insert-buffer-substring gnus-original-article-buffer))
723       (push-mark)
724       (message-goto-body)
725       (mime-edit-enclose-digest-region (point)(mark t)))))
726
727 (defun gnus-summary-post-digest (&optional n)
728   "Digest and forwards all articles in this series to a newsgroup."
729   (interactive "P")
730   (gnus-summary-mail-digest n t))
731  
732 (defun gnus-summary-resend-message (address n)
733   "Resend the current article to ADDRESS."
734   (interactive "sResend message(s) to: \nP")
735   (let ((articles (gnus-summary-work-articles n))
736         article)
737     (while (setq article (pop articles))
738       (gnus-summary-select-article nil nil nil article)
739       (save-excursion
740         (set-buffer gnus-original-article-buffer)
741         (message-resend address)))))
742
743 (defun gnus-summary-post-forward (&optional full-headers)
744   "Forward the current article to a newsgroup.
745 If FULL-HEADERS (the prefix), include full headers when forwarding."
746   (interactive "P")
747   (gnus-summary-mail-forward full-headers t))
748
749 (defvar gnus-nastygram-message
750   "The following article was inappropriately posted to %s.\n\n"
751   "Format string to insert in nastygrams.
752 The current group name will be inserted at \"%s\".")
753
754 (defun gnus-summary-mail-nastygram (n)
755   "Send a nastygram to the author of the current article."
756   (interactive "P")
757   (when (or gnus-expert-user
758             (gnus-y-or-n-p
759              "Really send a nastygram to the author of the current article? "))
760     (let ((group gnus-newsgroup-name))
761       (gnus-summary-reply-with-original n)
762       (set-buffer gnus-message-buffer)
763       (message-goto-body)
764       (insert (format gnus-nastygram-message group))
765       (message-send-and-exit))))
766
767 (defun gnus-summary-mail-crosspost-complaint (n)
768   "Send a complaint about crossposting to the current article(s)."
769   (interactive "P")
770   (let ((articles (gnus-summary-work-articles n))
771         article)
772     (while (setq article (pop articles))
773       (set-buffer gnus-summary-buffer)
774       (gnus-summary-goto-subject article)
775       (let ((group (gnus-group-real-name gnus-newsgroup-name))
776             newsgroups followup-to)
777         (gnus-summary-select-article)
778         (set-buffer gnus-original-article-buffer)
779         (if (and (<= (length (message-tokenize-header
780                               (setq newsgroups
781                                     (mail-fetch-field "newsgroups"))
782                               ", "))
783                      1)
784                  (or (not (setq followup-to (mail-fetch-field "followup-to")))
785                      (not (member group (message-tokenize-header
786                                          followup-to ", ")))))
787             (if followup-to
788                 (gnus-message 1 "Followup-to restricted")
789               (gnus-message 1 "Not a crossposted article"))
790           (set-buffer gnus-summary-buffer)
791           (gnus-summary-reply-with-original 1)
792           (set-buffer gnus-message-buffer)
793           (message-goto-body)
794           (insert (format gnus-crosspost-complaint newsgroups group))
795           (message-goto-subject)
796           (re-search-forward " *$")
797           (replace-match " (crosspost notification)" t t)
798           (gnus-deactivate-mark)
799           (when (gnus-y-or-n-p "Send this complaint? ")
800             (message-send-and-exit)))))))
801
802 (defun gnus-summary-mail-other-window ()
803   "Compose mail in other window."
804   (interactive)
805   (gnus-setup-message 'message
806     (message-mail)))
807
808 (defun gnus-mail-parse-comma-list ()
809   (let (accumulated
810         beg)
811     (skip-chars-forward " ")
812     (while (not (eobp))
813       (setq beg (point))
814       (skip-chars-forward "^,")
815       (while (zerop
816               (save-excursion
817                 (save-restriction
818                   (let ((i 0))
819                     (narrow-to-region beg (point))
820                     (goto-char beg)
821                     (logand (progn
822                               (while (search-forward "\"" nil t)
823                                 (incf i))
824                               (if (zerop i) 2 i))
825                             2)))))
826         (skip-chars-forward ",")
827         (skip-chars-forward "^,"))
828       (skip-chars-backward " ")
829       (push (buffer-substring beg (point))
830             accumulated)
831       (skip-chars-forward "^,")
832       (skip-chars-forward ", "))
833     accumulated))
834
835 (defun gnus-inews-add-to-address (group)
836   (let ((to-address (mail-fetch-field "to")))
837     (when (and to-address
838                (gnus-alive-p))
839       ;; This mail group doesn't have a `to-list', so we add one
840       ;; here.  Magic!
841       (when (gnus-y-or-n-p
842              (format "Do you want to add this as `to-list': %s " to-address))
843         (gnus-group-add-parameter group (cons 'to-list to-address))))))
844
845 (defun gnus-put-message ()
846   "Put the current message in some group and return to Gnus."
847   (interactive)
848   (let ((reply gnus-article-reply)
849         (winconf gnus-prev-winconf)
850         (group gnus-newsgroup-name))
851
852     (or (and group (not (gnus-group-read-only-p group)))
853         (setq group (read-string "Put in group: " nil
854                                  (gnus-writable-groups))))
855     (when (gnus-gethash group gnus-newsrc-hashtb)
856       (error "No such group: %s" group))
857
858     (save-excursion
859       (save-restriction
860         (widen)
861         (message-narrow-to-headers)
862         (let (gnus-deletable-headers)
863           (if (message-news-p)
864               (message-generate-headers message-required-news-headers)
865             (message-generate-headers message-required-mail-headers)))
866         (goto-char (point-max))
867         (insert "Gcc: " group "\n")
868         (widen)))
869
870     (gnus-inews-do-gcc)
871
872     (when (get-buffer gnus-group-buffer)
873       (when (gnus-buffer-exists-p (car-safe reply))
874         (set-buffer (car reply))
875         (and (cdr reply)
876              (gnus-summary-mark-article-as-replied
877               (cdr reply))))
878       (when winconf
879         (set-window-configuration winconf)))))
880
881 (defun gnus-article-mail (yank)
882   "Send a reply to the address near point.
883 If YANK is non-nil, include the original article."
884   (interactive "P")
885   (let ((address
886          (buffer-substring
887           (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point)))
888           (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point))))))
889     (when address
890       (message-reply address)
891       (when yank
892         (gnus-inews-yank-articles (list (cdr gnus-article-current)))))))
893
894 (defvar nntp-server-type)
895 (defun gnus-bug ()
896   "Send a bug report to the Gnus maintainers."
897   (interactive)
898   (unless (gnus-alive-p)
899     (error "Gnus has been shut down"))
900   (gnus-setup-message 'bug
901     (delete-other-windows)
902     (when gnus-bug-create-help-buffer
903       (switch-to-buffer "*Gnus Help Bug*")
904       (erase-buffer)
905       (insert gnus-bug-message)
906       (goto-char (point-min)))
907     (message-pop-to-buffer "*Gnus Bug*")
908     (message-setup
909      `((To . ,gnus-maintainer) (Cc . ,semi-gnus-developers) (Subject . "")))
910     (when gnus-bug-create-help-buffer
911       (push `(gnus-bug-kill-buffer) message-send-actions))
912     (goto-char (point-min))
913     (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
914     (forward-line 1)
915     (insert (gnus-version) "\n"
916             (emacs-version) "\n")
917     (when (and (boundp 'nntp-server-type)
918                (stringp nntp-server-type))
919       (insert nntp-server-type))
920     (insert "\n\n\n\n\n")
921     (gnus-debug)
922     (goto-char (point-min))
923     (search-forward "Subject: " nil t)
924     (message "")))
925
926 (defun gnus-bug-kill-buffer ()
927   (when (get-buffer "*Gnus Help Bug*")
928     (kill-buffer "*Gnus Help Bug*")))
929
930 (defun gnus-debug ()
931   "Attempts to go through the Gnus source file and report what variables have been changed.
932 The source file has to be in the Emacs load path."
933   (interactive)
934   (let ((files '("gnus.el" "gnus-sum.el" "gnus-group.el"
935                  "gnus-art.el" "gnus-start.el" "gnus-async.el"
936                  "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el"
937                  "nnmail.el" "message.el"))
938         (point (point))
939         file expr olist sym)
940     (gnus-message 4 "Please wait while we snoop your variables...")
941     (sit-for 0)
942     ;; Go through all the files looking for non-default values for variables.
943     (save-excursion
944       (set-buffer (gnus-get-buffer-create " *gnus bug info*"))
945       (while files
946         (erase-buffer)
947         (when (and (setq file (locate-library (pop files)))
948                    (file-exists-p file))
949           (insert-file-contents file)
950           (goto-char (point-min))
951           (if (not (re-search-forward "^;;* *Internal variables" nil t))
952               (gnus-message 4 "Malformed sources in file %s" file)
953             (narrow-to-region (point-min) (point))
954             (goto-char (point-min))
955             (while (setq expr (ignore-errors (read (current-buffer))))
956               (ignore-errors
957                 (and (or (eq (car expr) 'defvar)
958                          (eq (car expr) 'defcustom))
959                      (stringp (nth 3 expr))
960                      (or (not (boundp (nth 1 expr)))
961                          (not (equal (eval (nth 2 expr))
962                                      (symbol-value (nth 1 expr)))))
963                      (push (nth 1 expr) olist)))))))
964       (kill-buffer (current-buffer)))
965     (when (setq olist (nreverse olist))
966       (insert "------------------ Environment follows ------------------\n\n"))
967     (while olist
968       (if (boundp (car olist))
969           (condition-case ()
970               (pp `(setq ,(car olist)
971                          ,(if (or (consp (setq sym (symbol-value (car olist))))
972                                   (and (symbolp sym)
973                                        (not (or (eq sym nil)
974                                                 (eq sym t)))))
975                               (list 'quote (symbol-value (car olist)))
976                             (symbol-value (car olist))))
977                   (current-buffer))
978             (error
979              (format "(setq %s 'whatever)\n" (car olist))))
980         (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
981       (setq olist (cdr olist)))
982     (insert "\n\n")
983     ;; Remove any control chars - they seem to cause trouble for some
984     ;; mailers.  (Byte-compiled output from the stuff above.)
985     (goto-char point)
986     (while (re-search-forward "[\000-\010\013-\037\200-\237]" nil t)
987       (replace-match (format "\\%03o" (string-to-char (match-string 0)))
988                      t t))))
989
990 ;;; Treatment of rejected articles.
991 ;;; Bounced mail.
992
993 (defun gnus-summary-resend-bounced-mail (&optional fetch)
994   "Re-mail the current message.
995 This only makes sense if the current message is a bounce message than
996 contains some mail you have written which has been bounced back to
997 you.
998 If FETCH, try to fetch the article that this is a reply to, if indeed
999 this is a reply."
1000   (interactive "P")
1001   (gnus-summary-select-article t)
1002   (set-buffer gnus-original-article-buffer)
1003   (let ((gnus-message-setup-hook '(gnus-maybe-setup-default-charset)))
1004     (gnus-setup-message 'compose-bounce
1005       (let* ((references (mail-fetch-field "references"))
1006              (parent (and references (gnus-parent-id references))))
1007         (message-bounce)
1008         ;; If there are references, we fetch the article we answered to.
1009         (and fetch parent
1010              (gnus-summary-refer-article parent)
1011              (gnus-summary-show-all-headers))))))
1012
1013 ;;; Gcc handling.
1014
1015 ;; Do Gcc handling, which copied the message over to some group.
1016 (defun gnus-inews-do-gcc (&optional gcc)
1017   (interactive)
1018   (when (gnus-alive-p)
1019     (save-excursion
1020       (save-restriction
1021         (message-narrow-to-headers)
1022         (let ((gcc (or gcc (mail-fetch-field "gcc" nil t)))
1023               (coding-system-for-write 'raw-text)
1024               groups group method)
1025           (when gcc
1026             (message-remove-header "gcc")
1027             (widen)
1028             (setq groups (message-tokenize-header gcc " ,"))
1029             ;; Copy the article over to some group(s).
1030             (while (setq group (pop groups))
1031               (gnus-check-server
1032                (setq method
1033                      (cond ((and (null (gnus-get-info group))
1034                                  (eq (car gnus-message-archive-method)
1035                                      (car
1036                                       (gnus-server-to-method
1037                                        (gnus-group-method group)))))
1038                             ;; If the group doesn't exist, we assume
1039                             ;; it's an archive group...
1040                             gnus-message-archive-method)
1041                            ;; Use the method.
1042                            ((gnus-info-method (gnus-get-info group))
1043                             (gnus-info-method (gnus-get-info group)))
1044                            ;; Find the method.
1045                            (t (gnus-group-method group)))))
1046               (gnus-check-server method)
1047               (unless (gnus-request-group group t method)
1048                 (gnus-request-create-group group method))
1049               (save-excursion
1050                 (nnheader-set-temp-buffer " *acc*")
1051                 (insert-buffer-substring message-encoding-buffer)
1052                 (gnus-run-hooks 'gnus-before-do-gcc-hook)
1053                 (goto-char (point-min))
1054                 (when (re-search-forward
1055                        (concat "^" (regexp-quote mail-header-separator) "$")
1056                        nil t)
1057                   (replace-match "" t t ))
1058                 (unless (gnus-request-accept-article group method t t)
1059                   (gnus-message 1 "Couldn't store article in group %s: %s"
1060                                 group (gnus-status-message method))
1061                   (sit-for 2))
1062                 (kill-buffer (current-buffer))))))))))
1063
1064 (defun gnus-inews-insert-gcc ()
1065   "Insert Gcc headers based on `gnus-outgoing-message-group'."
1066   (save-excursion
1067     (save-restriction
1068       (message-narrow-to-headers)
1069       (let* ((group gnus-outgoing-message-group)
1070              (gcc (cond
1071                    ((gnus-functionp group)
1072                     (funcall group))
1073                    ((or (stringp group) (list group))
1074                     group))))
1075         (when gcc
1076           (insert "Gcc: "
1077                   (if (stringp gcc) gcc
1078                     (mapconcat 'identity gcc " "))
1079                   "\n"))))))
1080
1081 (defun gnus-inews-insert-archive-gcc (&optional group)
1082   "Insert the Gcc to say where the article is to be archived."
1083   (let* ((var gnus-message-archive-group)
1084          (group (or group gnus-newsgroup-name ""))
1085          (gcc-self-val
1086           (and gnus-newsgroup-name
1087                (gnus-group-find-parameter
1088                 gnus-newsgroup-name 'gcc-self)))
1089          result
1090          (groups
1091           (cond
1092            ((null gnus-message-archive-method)
1093             ;; Ignore.
1094             nil)
1095            ((stringp var)
1096             ;; Just a single group.
1097             (list var))
1098            ((null var)
1099             ;; We don't want this.
1100             nil)
1101            ((and (listp var) (stringp (car var)))
1102             ;; A list of groups.
1103             var)
1104            ((gnus-functionp var)
1105             ;; A function.
1106             (funcall var group))
1107            (t
1108             ;; An alist of regexps/functions/forms.
1109             (while (and var
1110                         (not
1111                          (setq result
1112                                (cond
1113                                 ((stringp (caar var))
1114                                  ;; Regexp.
1115                                  (when (string-match (caar var) group)
1116                                    (cdar var)))
1117                                 ((gnus-functionp (car var))
1118                                  ;; Function.
1119                                  (funcall (car var) group))
1120                                 (t
1121                                  (eval (car var)))))))
1122               (setq var (cdr var)))
1123             result)))
1124          name)
1125     (when (or groups gcc-self-val)
1126       (when (stringp groups)
1127         (setq groups (list groups)))
1128       (save-excursion
1129         (save-restriction
1130           (message-narrow-to-headers)
1131           (goto-char (point-max))
1132           (insert "Gcc: ")
1133           (if gcc-self-val
1134               ;; Use the `gcc-self' param value instead.
1135               (progn
1136                 (insert
1137                  (if (stringp gcc-self-val)
1138                      gcc-self-val
1139                    group))
1140                 (if (not (eq gcc-self-val 'none))
1141                     (insert "\n")
1142                   (progn
1143                     (beginning-of-line)
1144                     (kill-line))))
1145             ;; Use the list of groups.
1146             (while (setq name (pop groups))
1147               (insert (if (string-match ":" name)
1148                           name
1149                         (gnus-group-prefixed-name
1150                          name gnus-message-archive-method)))
1151               (when groups
1152                 (insert " ")))
1153             (insert "\n")))))))
1154
1155 ;;; Posting styles.
1156
1157 (defvar gnus-message-style-insertions nil)
1158
1159 (defun gnus-configure-posting-styles ()
1160   "Configure posting styles according to `gnus-posting-styles'."
1161   (unless gnus-inhibit-posting-styles
1162     (let ((styles gnus-posting-styles)
1163           (gnus-newsgroup-name (or gnus-newsgroup-name ""))
1164           style match variable attribute value value-value)
1165       (make-local-variable 'gnus-message-style-insertions)
1166       ;; If the group has a posting-style parameter, add it at the end with a
1167       ;; regexp matching everything, to be sure it takes precedence over all
1168       ;; the others.
1169       (unless (zerop (length gnus-newsgroup-name))
1170         (let ((tmp-style (gnus-group-find-parameter
1171                           gnus-newsgroup-name 'posting-style t)))
1172           (when tmp-style
1173             (setq styles (append styles (list (cons ".*" tmp-style)))))))
1174       ;; Go through all styles and look for matches.
1175       (while styles
1176         (setq style (pop styles)
1177               match (pop style))
1178         (when (cond
1179                ((stringp match)
1180                 ;; Regexp string match on the group name.
1181                 (string-match match gnus-newsgroup-name))
1182                ((or (symbolp match)
1183                     (gnus-functionp match))
1184                 (cond
1185                  ((gnus-functionp match)
1186                   ;; Function to be called.
1187                   (funcall match))
1188                  ((boundp match)
1189                   ;; Variable to be checked.
1190                   (symbol-value match))))
1191                ((listp match)
1192                 ;; This is a form to be evaled.
1193                 (eval match)))
1194           ;; We have a match, so we set the variables.
1195           (while style
1196             (setq attribute (pop style)
1197                   value (cadr attribute)
1198                   variable nil)
1199             ;; We find the variable that is to be modified.
1200             (if (and (not (stringp (car attribute)))
1201                      (not (eq 'body (car attribute)))
1202                      (not (setq variable
1203                                 (cdr (assq (car attribute)
1204                                            gnus-posting-style-alist)))))
1205                 (message "Couldn't find attribute %s" (car attribute))
1206               ;; We get the value.
1207               (setq value-value
1208                     (cond
1209                      ((stringp value)
1210                       value)
1211                      ((or (symbolp value)
1212                           (gnus-functionp value))
1213                       (cond ((gnus-functionp value)
1214                              (funcall value))
1215                             ((boundp value)
1216                              (symbol-value value))))
1217                      ((listp value)
1218                       (eval value))))
1219               (if variable
1220                   ;; This is an ordinary variable.
1221                   (set (make-local-variable variable) value-value)
1222                 ;; This is either a body or a header to be inserted in the
1223                 ;; message.
1224                 (let ((attr (car attribute)))
1225                   (make-local-variable 'message-setup-hook)
1226                   (if (eq 'body attr)
1227                       (add-hook 'message-setup-hook
1228                                 `(lambda ()
1229                                    (save-excursion
1230                                      (message-goto-body)
1231                                      (insert ,value-value))))
1232                     (add-hook 'message-setup-hook
1233                               'gnus-message-insert-stylings)
1234                     (push (cons (if (stringp attr) attr
1235                                   (symbol-name attr))
1236                                 value-value)
1237                           gnus-message-style-insertions)))))))))))
1238
1239 (defun gnus-message-insert-stylings ()
1240   (let (val)
1241     (save-excursion
1242       (message-goto-eoh)
1243       (while (setq val (pop gnus-message-style-insertions))
1244         (when (cdr val)
1245           (insert (car val) ": " (cdr val) "\n"))
1246         (gnus-pull (car val) gnus-message-style-insertions t)))))
1247
1248
1249 ;;; @ for MIME Edit mode
1250 ;;;
1251
1252 (defun gnus-maybe-setup-default-charset ()
1253   (let ((charset
1254          (and (boundp 'gnus-summary-buffer)
1255               (buffer-live-p gnus-summary-buffer)
1256               (save-excursion
1257                 (set-buffer gnus-summary-buffer)
1258                 default-mime-charset))))
1259     (if charset
1260         (progn
1261           (make-local-variable 'default-mime-charset)
1262           (setq default-mime-charset charset)
1263           ))))
1264
1265
1266 ;;; Allow redefinition of functions.
1267
1268 (gnus-ems-redefine)
1269
1270 (provide 'gnus-msg)
1271
1272 ;;; gnus-msg.el ends here