• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/gnus/

Lines Matching +defs:gnus +defs:summary +defs:post +defs:forward

0 ;;; gnus-msg.el --- mail and post interface for Gnus
7 ;; Lars Magne Ingebrigtsen <larsi@gnus.org>
33 (require 'gnus)
34 (require 'gnus-ems)
36 (require 'gnus-art)
37 (require 'gnus-util)
39 (defcustom gnus-post-method 'current
50 in the documentation of `gnus-select-method'. It can also be a list of
53 :group 'gnus-group-foreign
54 :link '(custom-manual "(gnus)Posting Server")
57 (sexp :tag "Methods" ,gnus-select-method)))
59 (defcustom gnus-outgoing-message-group nil
69 :group 'gnus-message
75 (defcustom gnus-mailing-list-groups nil
80 :group 'gnus-message
84 (defcustom gnus-add-to-list nil
86 :group 'gnus-message
89 (defcustom gnus-crosspost-complaint
106 :group 'gnus-message
109 (defcustom gnus-message-setup-hook nil
111 :group 'gnus-message
114 (defcustom gnus-bug-create-help-buffer t
116 :group 'gnus-message
119 (defcustom gnus-posting-styles nil
121 See Info node `(gnus)Posting Styles'."
122 :group 'gnus-message
123 :link '(custom-manual "(gnus)Posting Styles")
146 (defcustom gnus-gcc-mark-as-read nil
149 :group 'gnus-message
152 (make-obsolete-variable 'gnus-inews-mark-gcc-as-read
153 'gnus-gcc-mark-as-read)
155 (defcustom gnus-gcc-externalize-attachments nil
161 :group 'gnus-message
166 (gnus-define-group-parameter
171 :variable gnus-group-posting-charset-alist
190 :variable-group gnus-charset
211 (defcustom gnus-debug-files
212 '("gnus.el" "gnus-sum.el" "gnus-group.el"
213 "gnus-art.el" "gnus-start.el" "gnus-async.el"
214 "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el"
215 "gnus-agent.el" "gnus-cache.el" "gnus-srvr.el"
217 "Files whose variables will be reported in `gnus-bug'."
219 :group 'gnus-message
222 (defcustom gnus-debug-exclude-variables
225 "Variables that should not be reported in `gnus-bug'."
227 :group 'gnus-message
230 (defcustom gnus-discouraged-post-methods
233 This variable is used only when `gnus-post-method' is `current'."
235 :group 'gnus-group-foreign
238 (defcustom gnus-message-replysign
242 :group 'gnus-message
245 (defcustom gnus-message-replyencrypt
249 :group 'gnus-message
252 (defcustom gnus-message-replysignencrypted
255 :group 'gnus-message
258 (defcustom gnus-confirm-mail-reply-to-news nil
267 :group 'gnus-message
273 (defcustom gnus-confirm-treat-mail-like-news
276 when replying by mail. See the `gnus-confirm-mail-reply-to-news' variable
280 :group 'gnus-message
283 (defcustom gnus-summary-resend-default-address t
286 `gnus-summary-resend-message'."
288 :group 'gnus-message
293 (defvar gnus-inhibit-posting-styles nil
296 (defvar gnus-article-yanked-articles nil)
297 (defvar gnus-message-buffer "*Mail Gnus*")
298 (defvar gnus-article-copy nil)
299 (defvar gnus-check-before-posting nil)
300 (defvar gnus-last-posting-server nil)
301 (defvar gnus-message-group-art nil)
303 (defvar gnus-msg-force-broken-reply-to nil)
305 (defconst gnus-bug-message
327 (autoload 'gnus-uu-post-news "gnus-uu" nil t)
339 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map)
340 "p" gnus-summary-post-news
341 "i" gnus-summary-news-other-window
342 "f" gnus-summary-followup
343 "F" gnus-summary-followup-with-original
344 "c" gnus-summary-cancel-article
345 "s" gnus-summary-supersede-article
346 "r" gnus-summary-reply
347 "y" gnus-summary-yank-message
348 "R" gnus-summary-reply-with-original
349 "w" gnus-summary-wide-reply
350 "W" gnus-summary-wide-reply-with-original
351 "v" gnus-summary-very-wide-reply
352 "V" gnus-summary-very-wide-reply-with-original
353 "n" gnus-summary-followup-to-mail
354 "N" gnus-summary-followup-to-mail-with-original
355 "m" gnus-summary-mail-other-window
356 "u" gnus-uu-post-news
357 "\M-c" gnus-summary-mail-crosspost-complaint
358 "Br" gnus-summary-reply-broken-reply-to
359 "BR" gnus-summary-reply-broken-reply-to-with-original
360 "om" gnus-summary-mail-forward
361 "op" gnus-summary-post-forward
362 "Om" gnus-uu-digest-mail-forward
363 "Op" gnus-uu-digest-post-forward)
365 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
366 "b" gnus-summary-resend-bounced-mail
367 ;; "c" gnus-summary-send-draft
368 "r" gnus-summary-resend-message
369 "e" gnus-summary-resend-message-edit)
373 (defun gnus-inews-make-draft ()
375 (gnus-inews-make-draft-meta-information
376 ,gnus-newsgroup-name ',gnus-article-reply)))
378 (defvar gnus-article-reply nil)
379 (defmacro gnus-setup-message (config &rest forms)
380 (let ((winconf (make-symbol "gnus-setup-message-winconf"))
381 (buffer (make-symbol "gnus-setup-message-buffer"))
382 (article (make-symbol "gnus-setup-message-article"))
383 (yanked (make-symbol "gnus-setup-yanked-articles"))
384 (group (make-symbol "gnus-setup-message-group")))
387 (,article gnus-article-reply)
388 (,yanked gnus-article-yanked-articles)
389 (,group gnus-newsgroup-name)
395 (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
396 (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
398 ;; gnus-inews-add-send-actions, but this is too late when
403 (setq message-mailer (gnus-extended-version)))))
405 ;; the variable `gnus-newsgroup-name' does not honor a dynamically
406 ;; scoped or setq'ed value from a caller like `C-u gnus-summary-mail'.
409 ;; added an optional argument to `gnus-configure-posting-styles' to
414 (gnus-configure-posting-styles ,group))
416 ;; There may be an old " *gnus article copy*" buffer.
417 (let (gnus-article-copy)
418 (gnus-configure-posting-styles ,group)))))
419 (gnus-pull ',(intern gnus-draft-meta-information-header)
424 (intern gnus-draft-meta-information-header)
425 (gnus-inews-make-draft))
430 (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config
432 (setq gnus-message-buffer (current-buffer))
433 (set (make-local-variable 'gnus-message-group-art)
435 (set (make-local-variable 'gnus-newsgroup-name) ,group)
436 (gnus-run-hooks 'gnus-message-setup-hook)
441 (gnus-make-local-hook 'kill-buffer-hook)
442 (gnus-make-local-hook 'change-major-mode-hook)
448 (gnus-add-buffer)
449 (gnus-configure-windows ,config t)
450 (run-hooks 'post-command-hook)
453 (defun gnus-inews-make-draft-meta-information (group article)
462 (defun gnus-msg-mail (&optional to subject other-headers continue
470 (gnus-setup-message 'message
481 (defun gnus-button-mailto (address)
483 (set-buffer (gnus-copy-article-buffer))
484 (gnus-setup-message 'message
488 (defun gnus-button-reply (&optional to-address wide)
491 (gnus-setup-message 'message
495 (define-mail-user-agent 'gnus-user-agent
496 'gnus-msg-mail 'message-send-and-exit
499 (defun gnus-setup-posting-charset (group)
500 (let ((alist gnus-group-posting-charset-alist)
514 (defun gnus-inews-add-send-actions (winconf buffer article
516 (gnus-make-local-hook 'message-sent-hook)
517 (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
518 'gnus-inews-do-gcc) nil t)
519 (when gnus-agent
520 (gnus-make-local-hook 'message-header-hook)
521 (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t))
522 (setq message-post-method
524 (gnus-post-method arg ,gnus-newsgroup-name)))
526 `(when (gnus-buffer-exists-p ,buffer)
536 `(when (gnus-buffer-exists-p ,buffer)
540 (if (eq config 'forward)
541 `(gnus-summary-mark-article-as-forwarded ',to-be-marked)
542 `(gnus-summary-mark-article-as-replied ',to-be-marked)))))
545 (put 'gnus-setup-message 'lisp-indent-function 1)
546 (put 'gnus-setup-message 'edebug-form-spec '(form body))
548 ;;; Post news commands of Gnus group mode and summary mode
550 (defun gnus-group-mail (&optional arg)
555 ;; We can't `let' gnus-newsgroup-name here, since that leads
557 (let ((group gnus-newsgroup-name)
559 (gnus-article-copy)
563 (setq gnus-newsgroup-name
567 gnus-active-hashtb nil
568 (gnus-read-active-file-p))
569 (gnus-group-group-name))
571 ;; #### see comment in gnus-setup-message -- drv
572 (gnus-setup-message 'message (message-mail)))
575 (setq gnus-newsgroup-name group)))))
577 (defun gnus-group-news (&optional arg)
579 If ARG, post to group under point.
580 If ARG is 1, prompt for group name to post to.
584 network. The corresponding back end must have a 'request-post method."
586 ;; We can't `let' gnus-newsgroup-name here, since that leads
588 (let ((group gnus-newsgroup-name)
590 (gnus-article-copy)
594 (setq gnus-newsgroup-name
598 gnus-active-hashtb nil
599 (gnus-read-active-file-p))
600 (gnus-group-group-name))
602 ;; #### see comment in gnus-setup-message -- drv
603 (gnus-setup-message 'message
604 (message-news (gnus-group-real-name gnus-newsgroup-name))))
607 (setq gnus-newsgroup-name group)))))
609 (defun gnus-group-post-news (&optional arg)
611 If ARG, post to group under point. If ARG is 1, prompt for group name.
616 (let ((gnus-newsgroup-name
619 (completing-read "Newsgroup: " gnus-active-hashtb nil
620 (gnus-read-active-file-p))
621 (gnus-group-group-name))
624 (gnus-article-copy))
625 (gnus-post-news 'post gnus-newsgroup-name nil nil nil nil
626 (string= gnus-newsgroup-name ""))))
628 (defun gnus-summary-mail-other-window (&optional arg)
634 ;; We can't `let' gnus-newsgroup-name here, since that leads
636 (let ((group gnus-newsgroup-name)
638 (gnus-article-copy)
642 (setq gnus-newsgroup-name
646 gnus-active-hashtb nil
647 (gnus-read-active-file-p))
649 gnus-newsgroup-name))
650 ;; #### see comment in gnus-setup-message -- drv
651 (gnus-setup-message 'message (message-mail)))
654 (setq gnus-newsgroup-name group)))))
656 (defun gnus-summary-news-other-window (&optional arg)
659 If ARG, don't do that. If ARG is 1, prompt for group name to post to.
663 network. The corresponding back end must have a 'request-post method."
665 ;; We can't `let' gnus-newsgroup-name here, since that leads
667 (let ((group gnus-newsgroup-name)
669 (gnus-article-copy)
673 (setq gnus-newsgroup-name
677 gnus-active-hashtb nil
678 (gnus-read-active-file-p))
680 gnus-newsgroup-name))
681 ;; #### see comment in gnus-setup-message -- drv
682 (gnus-setup-message 'message
684 (message-news (gnus-group-real-name gnus-newsgroup-name))
685 (set (make-local-variable 'gnus-discouraged-post-methods)
687 (car (gnus-find-method-for-group gnus-newsgroup-name))
688 (copy-sequence gnus-discouraged-post-methods))))))
691 (setq gnus-newsgroup-name group)))))
693 (defun gnus-summary-post-news (&optional arg)
695 If ARG, don't do that. If ARG is 1, prompt for a group name to post to.
700 (let ((gnus-newsgroup-name
703 (completing-read "Newsgroup: " gnus-active-hashtb nil
704 (gnus-read-active-file-p))
706 gnus-newsgroup-name))
708 (gnus-article-copy))
709 (gnus-post-news 'post gnus-newsgroup-name)))
712 (defun gnus-summary-followup (yank &optional force-news)
720 (gnus-summary-work-articles 1))))
722 (gnus-summary-goto-subject
727 (gnus-summary-select-article))
728 (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
729 (gnus-newsgroup-name gnus-newsgroup-name))
731 (gnus-post-news nil gnus-newsgroup-name
732 headers gnus-article-buffer
734 (gnus-summary-handle-replysign)))
736 (defun gnus-summary-followup-with-original (n &optional force-news)
741 (gnus-summary-followup (gnus-summary-work-articles n) force-news))
743 (defun gnus-summary-followup-to-mail (&optional arg)
747 (gnus-summary-work-articles 1))))
748 (gnus-summary-followup arg t))
750 (defun gnus-summary-followup-to-mail-with-original (&optional arg)
753 (gnus-summary-followup (gnus-summary-work-articles arg) t))
755 (defun gnus-inews-yank-articles (articles)
763 (set-buffer gnus-summary-buffer)
764 (gnus-summary-select-article nil nil nil article)
765 (gnus-summary-remove-process-mark article))
766 (gnus-copy-article-buffer nil yank-string)
767 (let ((message-reply-buffer gnus-article-copy)
770 (with-current-buffer gnus-article-copy
782 (defun gnus-summary-cancel-article (&optional n symp)
786 post using the current select method."
787 (interactive (gnus-interactive "P\ny"))
788 (let ((articles (gnus-summary-work-articles n))
789 (message-post-method
791 (gnus-post-method (eq ',symp 'a) ,gnus-newsgroup-name)))
794 (when (gnus-summary-select-article t nil nil article)
795 (when (gnus-eval-in-buffer-window gnus-original-article-buffer
797 (gnus-summary-mark-as-read article gnus-canceled-mark)
798 (gnus-cache-remove-article 1))
799 (gnus-article-hide-headers-if-wanted))
800 (gnus-summary-remove-process-mark article))))
802 (defun gnus-summary-supersede-article ()
807 (let ((article (gnus-summary-article-number)))
808 (gnus-setup-message 'reply-yank
809 (gnus-summary-select-article t)
810 (set-buffer gnus-original-article-buffer)
814 (when (gnus-buffer-exists-p ,gnus-summary-buffer)
816 (set-buffer ,gnus-summary-buffer)
817 (gnus-cache-possibly-remove-article ,article nil nil nil t)
818 (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
824 (defun gnus-copy-article-buffer (&optional article-buffer yank-string)
826 ;; this copy is in the buffer gnus-article-copy.
827 ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
828 ;; this buffer should be passed to all mail/news reply/post routines.
829 (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*"))
831 (set-buffer gnus-article-copy)
833 (let ((article-buffer (or article-buffer gnus-article-buffer))
836 (gnus-buffer-exists-p article-buffer)))
840 (let ((gnus-newsgroup-charset (or gnus-article-charset
841 gnus-newsgroup-charset))
842 (gnus-newsgroup-ignored-charsets
843 (or gnus-article-ignored-charsets
844 gnus-newsgroup-ignored-charsets)))
849 (copy-to-buffer gnus-article-copy (point-min) (point-max))
850 (set-buffer gnus-article-copy)
855 (gnus-article-delete-text-of-type 'annotation)
856 (gnus-article-delete-text-of-type 'multipart)
857 (gnus-remove-text-with-property 'gnus-prev)
858 (gnus-remove-text-with-property 'gnus-next)
859 (gnus-remove-text-with-property 'gnus-decoration)
865 (set-buffer gnus-original-article-buffer)
868 (forward-line 1))
875 (set-buffer gnus-article-copy)
880 (insert-buffer-substring gnus-original-article-buffer beg end)
882 (let ((gnus-article-decode-hook
884 (copy-sequence gnus-article-decode-hook)))
886 (run-hooks 'gnus-article-decode-hook)))))
887 gnus-article-copy)))
889 (defun gnus-post-news (post &optional group header article-buffer yank subject
892 (gnus-copy-article-buffer))
893 (let ((gnus-article-reply (and article-buffer (gnus-summary-article-number)))
894 (gnus-article-yanked-articles yank)
895 (add-to-list gnus-add-to-list))
896 (gnus-setup-message (cond (yank 'reply-yank)
899 (let* ((group (or group gnus-newsgroup-name))
900 (charset (gnus-group-name-charset nil group))
905 (setq to-address (gnus-parameter-to-address group)
906 to-group (gnus-group-find-parameter group 'to-group)
907 to-list (gnus-parameter-to-list group)
908 newsgroup-p (gnus-group-find-parameter group 'newsgroup)
909 mailing-list (when gnus-mailing-list-groups
910 (string-match gnus-mailing-list-groups group))
911 group (gnus-group-name-decode (gnus-group-real-name group)
914 (gnus-news-group-p to-group))
917 (and (gnus-news-group-p
918 (or pgroup gnus-newsgroup-name)
919 (or header gnus-current-article))
924 (if post
927 (and (not (gnus-virtual-group-p pgroup)) group)))
928 (set-buffer gnus-article-copy)
929 (gnus-msg-treat-broken-reply-to)
938 (if post
946 (push (list 'gnus-inews-add-to-address pgroup)
948 (set-buffer gnus-article-copy)
949 (gnus-msg-treat-broken-reply-to)
952 (gnus-inews-yank-articles yank))))))
954 (defun gnus-msg-treat-broken-reply-to (&optional force)
957 (gnus-group-find-parameter
958 gnus-newsgroup-name 'broken-reply-to))
963 (defun gnus-post-method (arg group &optional silent)
966 (let ((gnus-post-method (or (gnus-parameter-post-method group)
967 gnus-post-method))
968 (group-method (gnus-find-method-for-group group)))
973 (or (and (listp gnus-post-method) ;If not current/native/nil
974 (not (listp (car gnus-post-method))) ; and not a list of methods
975 gnus-post-method) ;then use it.
976 gnus-select-method
977 message-post-method))
980 (if (eq gnus-post-method 'current)
981 gnus-select-method
983 ;; We query the user for a post method.
985 (and (listp gnus-post-method)
986 (listp (car gnus-post-method))))
990 (when (listp gnus-post-method)
991 (if (listp (car gnus-post-method))
992 gnus-post-method
993 (list gnus-post-method)))
994 gnus-secondary-select-methods
995 (mapcar 'cdr gnus-server-alist)
996 (mapcar 'car gnus-opened-servers)
997 (list gnus-select-method)
999 method-alist post-methods method)
1002 (setq method (gnus-server-get-method "" (pop methods)))
1003 (when (and (or (gnus-method-option-p method 'post)
1004 (gnus-method-option-p method 'post-mail))
1005 (not (member method post-methods)))
1006 (push method post-methods)))
1014 post-methods))
1018 (setq gnus-last-posting-server
1020 gnus-last-posting-server)
1022 gnus-last-posting-server
1025 (cons (or gnus-last-posting-server "") 0))))
1028 ((and (eq gnus-post-method 'current)
1029 (not (memq (car group-method) gnus-discouraged-post-methods))
1030 (gnus-get-function group-method 'request-post t))
1033 ;; Use gnus-post-method.
1034 ((listp gnus-post-method) ;A method...
1035 (assert (not (listp (car gnus-post-method)))) ;... not a list of methods.
1036 gnus-post-method)
1038 (t gnus-select-method))))
1043 (defun gnus-extended-version ()
1045 See the variable `gnus-user-agent'."
1047 (if (stringp gnus-user-agent)
1048 gnus-user-agent
1049 ;; `gnus-user-agent' is a list:
1051 (gnus-v
1052 (when (memq 'gnus gnus-user-agent)
1054 (prin1-to-string (gnus-continuum-version gnus-version) t)
1055 " (" gnus-version ")")))
1056 (emacs-v (gnus-emacs-version)))
1057 (concat gnus-v (when (and gnus-v emacs-v) " ")
1066 ;;; Mail reply commands of Gnus summary mode
1068 (defun gnus-summary-reply (&optional yank wide very-wide)
1076 (gnus-summary-work-articles 1))))
1080 (not (or (gnus-news-group-p gnus-newsgroup-name)
1081 gnus-confirm-treat-mail-like-news))
1082 (not (cond ((stringp gnus-confirm-mail-reply-to-news)
1083 (string-match gnus-confirm-mail-reply-to-news
1084 gnus-newsgroup-name))
1085 ((functionp gnus-confirm-mail-reply-to-news)
1086 (funcall gnus-confirm-mail-reply-to-news gnus-newsgroup-name))
1087 (t gnus-confirm-mail-reply-to-news)))
1093 (gnus-article-reply (or article (gnus-summary-article-number)))
1094 (gnus-article-yanked-articles yank)
1098 (gnus-summary-goto-subject article))
1099 (gnus-setup-message (if yank 'reply-yank 'reply)
1101 (gnus-summary-select-article)
1103 (gnus-summary-select-article nil nil nil article)
1105 (set-buffer (gnus-copy-article-buffer))
1106 (gnus-msg-treat-broken-reply-to)
1110 (set-buffer (gnus-copy-article-buffer))
1111 (gnus-msg-treat-broken-reply-to gnus-msg-force-broken-reply-to)
1121 (gnus-inews-yank-articles yank))
1122 (gnus-summary-handle-replysign)))))
1124 (defun gnus-summary-handle-replysign ()
1126 (when (or gnus-message-replysign gnus-message-replyencrypt)
1129 (set-buffer gnus-article-buffer)
1130 (setq signed (memq 'signed gnus-article-wash-types))
1131 (setq encrypted (memq 'encrypted gnus-article-wash-types)))
1132 (cond ((and gnus-message-replyencrypt encrypted)
1134 (if gnus-message-replysignencrypted
1137 ((and gnus-message-replysign signed)
1140 (defun gnus-summary-reply-with-original (n &optional wide)
1144 (gnus-summary-reply (gnus-summary-work-articles n) wide))
1146 (defun gnus-summary-reply-broken-reply-to (&optional yank wide very-wide)
1147 "Like `gnus-summary-reply' except removing reply-to field.
1154 (gnus-summary-work-articles 1))))
1155 (let ((gnus-msg-force-broken-reply-to t))
1156 (gnus-summary-reply yank wide very-wide)))
1158 (defun gnus-summary-reply-broken-reply-to-with-original (n &optional wide)
1159 "Like `gnus-summary-reply-with-original' except removing reply-to field.
1162 (gnus-summary-reply-broken-reply-to (gnus-summary-work-articles n) wide))
1164 (defun gnus-summary-wide-reply (&optional yank)
1170 (gnus-summary-work-articles 1))))
1171 (gnus-summary-reply yank t))
1173 (defun gnus-summary-wide-reply-with-original (n)
1178 (gnus-summary-reply-with-original n t))
1180 (defun gnus-summary-very-wide-reply (&optional yank)
1186 (gnus-summary-work-articles 1))))
1187 (gnus-summary-reply yank t (gnus-summary-work-articles yank)))
1189 (defun gnus-summary-very-wide-reply-with-original (n)
1193 (gnus-summary-reply
1194 (gnus-summary-work-articles n) t (gnus-summary-work-articles n)))
1196 (defun gnus-summary-mail-forward (&optional arg post)
1198 If process marks exist, forward all marked messages;
1199 if ARG is nil, see `message-forward-as-mime' and `message-forward-show-mml';
1200 if ARG is 1, decode the message and forward directly inline;
1201 if ARG is 2, forward message as an rfc822 MIME section;
1202 if ARG is 3, decode message and forward as an rfc822 MIME section;
1203 if ARG is 4, forward message directly inline;
1204 otherwise, use flipped `message-forward-as-mime'.
1205 If POST, post instead of mail.
1207 `message-forward-ignored-headers'."
1209 (if (cdr (gnus-summary-work-articles nil))
1211 (gnus-uu-digest-mail-forward arg post)
1213 (let ((message-forward-as-mime message-forward-as-mime)
1214 (message-forward-show-mml message-forward-show-mml))
1218 (setq message-forward-as-mime nil
1219 message-forward-show-mml t))
1221 (setq message-forward-as-mime t
1222 message-forward-show-mml nil))
1224 (setq message-forward-as-mime t
1225 message-forward-show-mml t))
1227 (setq message-forward-as-mime nil
1228 message-forward-show-mml nil))
1230 (setq message-forward-as-mime (not message-forward-as-mime))))
1231 (let* ((gnus-article-reply (gnus-summary-article-number))
1232 (gnus-article-yanked-articles (list gnus-article-reply)))
1233 (gnus-setup-message 'forward
1234 (gnus-summary-select-article)
1236 (or (and (gnus-buffer-live-p gnus-article-buffer)
1237 (with-current-buffer gnus-article-buffer
1238 gnus-article-charset))
1239 gnus-newsgroup-charset))
1241 gnus-newsgroup-ignored-charsets))
1242 (set-buffer gnus-original-article-buffer)
1243 (message-forward post)))))))
1245 (defun gnus-summary-resend-message (address n)
1250 (when (and gnus-summary-resend-default-address
1251 (gnus-buffer-live-p gnus-original-article-buffer))
1255 (with-current-buffer gnus-original-article-buffer
1258 (let ((articles (gnus-summary-work-articles n))
1261 (gnus-summary-select-article nil nil nil article)
1263 (set-buffer gnus-original-article-buffer)
1265 (gnus-summary-mark-article-as-forwarded article))))
1268 (defun gnus-summary-resend-message-edit ()
1274 (let ((article (gnus-summary-article-number)))
1275 (gnus-setup-message 'reply-yank
1276 (gnus-summary-select-article t)
1277 (set-buffer gnus-original-article-buffer)
1292 (when (re-search-forward "^To:\\|^Newsgroups:" nil 'move)
1293 (forward-char 1))
1296 (defun gnus-summary-post-forward (&optional arg)
1298 See `gnus-summary-mail-forward' for ARG."
1300 (gnus-summary-mail-forward arg t))
1302 (defvar gnus-nastygram-message
1307 (defun gnus-summary-mail-nastygram (n)
1310 (when (or gnus-expert-user
1311 (gnus-y-or-n-p
1313 (let ((group gnus-newsgroup-name))
1314 (gnus-summary-reply-with-original n)
1315 (set-buffer gnus-message-buffer)
1317 (insert (format gnus-nastygram-message group))
1320 (defun gnus-summary-mail-crosspost-complaint (n)
1323 (let ((articles (gnus-summary-work-articles n))
1326 (set-buffer gnus-summary-buffer)
1327 (gnus-summary-goto-subject article)
1328 (let ((group (gnus-group-real-name gnus-newsgroup-name))
1330 (gnus-summary-select-article)
1331 (set-buffer gnus-original-article-buffer)
1341 (gnus-message 1 "Followup-to restricted")
1342 (gnus-message 1 "Not a crossposted article"))
1343 (set-buffer gnus-summary-buffer)
1344 (gnus-summary-reply-with-original 1)
1345 (set-buffer gnus-message-buffer)
1347 (insert (format gnus-crosspost-complaint newsgroups group))
1349 (re-search-forward " *$")
1351 (gnus-deactivate-mark)
1352 (when (gnus-y-or-n-p "Send this complaint? ")
1355 (defun gnus-mail-parse-comma-list ()
1358 (skip-chars-forward " ")
1361 (skip-chars-forward "^,")
1369 (while (search-forward "\"" nil t)
1373 (skip-chars-forward ",")
1374 (skip-chars-forward "^,"))
1378 (skip-chars-forward "^,")
1379 (skip-chars-forward ", "))
1382 (defun gnus-inews-add-to-address (group)
1385 (gnus-alive-p))
1388 (when (gnus-y-or-n-p
1390 (gnus-group-add-parameter group (cons 'to-list to-address))))))
1392 (defun gnus-put-message ()
1395 (let ((reply gnus-article-reply)
1396 (winconf gnus-prev-winconf)
1397 (group gnus-newsgroup-name))
1399 (not (gnus-group-read-only-p group)))
1400 (setq group (read-string "Put in group: " nil (gnus-writable-groups))))
1402 (when (gnus-gethash group gnus-newsrc-hashtb)
1408 (let ((gnus-deletable-headers nil))
1418 (gnus-inews-do-gcc)
1419 (when (and (get-buffer gnus-group-buffer)
1420 (gnus-buffer-exists-p (car-safe reply))
1423 (gnus-summary-mark-article-as-replied (cdr reply)))
1427 (defun gnus-article-mail (yank)
1434 (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point))))))
1436 (gnus-msg-mail address)
1438 (gnus-inews-yank-articles (list (cdr gnus-article-current)))))))
1441 (defun gnus-bug ()
1444 (unless (gnus-alive-p)
1446 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
1449 (when gnus-bug-create-help-buffer
1452 (insert gnus-bug-message)
1456 (message-setup `((To . ,gnus-maintainer) (Subject . ""))))
1457 (when gnus-bug-create-help-buffer
1458 (push `(gnus-bug-kill-buffer) message-send-actions))
1460 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
1461 (forward-line 1)
1462 (insert (gnus-version) "\n"
1470 (set-buffer (gnus-get-buffer-create " *gnus environment info*"))
1472 (gnus-debug)
1476 (search-forward "Subject: " nil t)
1479 (defun gnus-bug-kill-buffer ()
1483 (defun gnus-summary-yank-message (buffer n)
1488 (gnus-summary-iterate n
1489 (let ((gnus-inhibit-treatment t))
1490 (gnus-summary-select-article))
1493 (message-yank-buffer gnus-article-buffer))))
1495 (defun gnus-debug ()
1499 (let ((files gnus-debug-files)
1502 (gnus-message 4 "Please wait while we snoop your variables...")
1506 (set-buffer (gnus-get-buffer-create " *gnus bug info*"))
1513 (if (not (re-search-forward "^;;* *Internal variables" nil t))
1514 (gnus-message 4 "Malformed sources in file %s" file)
1522 (not (memq (nth 1 expr) gnus-debug-exclude-variables))
1533 (gnus-pp
1547 (while (re-search-forward (mm-string-as-multibyte
1555 (defun gnus-summary-resend-bounced-mail (&optional fetch)
1563 (gnus-summary-select-article t)
1564 (set-buffer gnus-original-article-buffer)
1565 (gnus-setup-message 'compose-bounce
1567 (parent (and references (gnus-parent-id references))))
1571 (gnus-summary-refer-article parent)
1572 (gnus-summary-show-all-headers)))))
1576 (defun gnus-inews-group-method (group)
1580 ((and (null (gnus-get-info group))
1581 (eq (car (gnus-server-to-method gnus-message-archive-method))
1582 (car (gnus-server-to-method (gnus-group-method group)))))
1583 gnus-message-archive-method)
1585 ((gnus-info-method (gnus-get-info group))
1586 (gnus-info-method (gnus-get-info group)))
1588 (t (gnus-server-to-method (gnus-group-method group)))))
1591 (defun gnus-inews-do-gcc (&optional gcc)
1607 (unless (gnus-check-server
1608 (setq method (gnus-inews-group-method group)))
1611 (unless (gnus-request-group group nil method)
1612 (gnus-request-create-group group method))
1614 (if (stringp gnus-gcc-externalize-attachments)
1615 (string-match gnus-gcc-externalize-attachments group)
1616 gnus-gcc-externalize-attachments))
1636 (gnus-group-name-charset
1639 (gnus-group-name-charset
1650 (when (re-search-forward
1655 (gnus-request-accept-article group method t t))
1656 (gnus-message 1 "Couldn't store article in group %s: %s"
1657 group (gnus-status-message method))
1662 (gnus-alive-p)
1663 (or gnus-gcc-mark-as-read
1665 (boundp 'gnus-inews-mark-gcc-as-read)
1666 (symbol-value 'gnus-inews-mark-gcc-as-read))))
1667 (gnus-group-mark-article-read group (cdr group-art)))
1670 (defun gnus-inews-insert-gcc ()
1671 "Insert Gcc headers based on `gnus-outgoing-message-group'."
1675 (let* ((group gnus-outgoing-message-group)
1694 (defun gnus-inews-insert-archive-gcc (&optional group)
1696 (let* ((var gnus-message-archive-group)
1697 (group (or group gnus-newsgroup-name ""))
1699 (and gnus-newsgroup-name
1700 (not (equal gnus-newsgroup-name ""))
1701 (gnus-group-find-parameter
1702 gnus-newsgroup-name 'gcc-self)))
1706 ((null gnus-message-archive-method)
1757 (let ((group (or (gnus-group-find-parameter
1758 gnus-newsgroup-name 'parent-group)
1765 (gnus-delete-line)))
1770 (gnus-group-prefixed-name
1771 name gnus-message-archive-method))))
1779 (defun gnus-mailing-list-followup-to ()
1781 (let ((x-been-there (gnus-fetch-original-field "x-beenthere"))
1782 (list-post (gnus-fetch-original-field "list-post")))
1783 (when (and list-post
1784 (string-match "mailto:\\([^>]+\\)" list-post))
1785 (setq list-post (match-string 1 list-post)))
1786 (or list-post
1791 (defun gnus-configure-posting-styles (&optional group-name)
1792 "Configure posting styles according to `gnus-posting-styles'."
1793 (unless gnus-inhibit-posting-styles
1794 (let ((group (or group-name gnus-newsgroup-name ""))
1795 (styles gnus-posting-styles)
1801 (when gnus-newsgroup-name
1802 (let ((tmp-style (gnus-group-find-parameter group 'posting-style t)))
1815 (and (gnus-buffer-live-p gnus-article-copy)
1816 (with-current-buffer gnus-article-copy
1835 (and (gnus-buffer-live-p gnus-article-copy)
1836 (with-current-buffer gnus-article-copy
1896 (gnus-make-local-hook 'message-setup-hook)
1950 (gnus-ems-redefine)
1952 (provide 'gnus-msg)
1955 ;;; gnus-msg.el ends here