(defvar gnus-outgoing-message-group nil
"*All outgoing messages will be put in this group.
If you want to store all your outgoing mail and articles in the group
-\"nnml:archive\", you set this variable to that value. This variable
+\"nnml:archive\", you set this variable to that value. This variable
can also be a list of group names.
If you want to have greater control over what group to put each
(defvar gnus-sent-message-ids-length 1000
"The number of sent Message-IDs to save.")
+(defvar gnus-crosspost-complaint
+ "Hi,
+
+You posted the article below with the following Newsgroups header:
+
+Newsgroups: %s
+
+The %s group, at least, was an inappropriate recipient
+of this message. Please trim your Newsgroups header to exclude this
+group before posting in the future.
+
+Thank you.
+
+"
+ "Format string to be inserted when complaining about crossposts.
+The first %s will be replaced by the Newsgroups header;
+the second with the current group name.")
+
;;; Internal variables.
(defvar gnus-message-buffer "*Mail Gnus*")
;;; Gnus Posting Functions
;;;
-(gnus-define-keys
- (gnus-summary-send-map "S" gnus-summary-mode-map)
- "p" gnus-summary-post-news
- "f" gnus-summary-followup
- "F" gnus-summary-followup-with-original
- "c" gnus-summary-cancel-article
- "s" gnus-summary-supersede-article
- "r" gnus-summary-reply
- "R" gnus-summary-reply-with-original
- "m" gnus-summary-mail-other-window
- "u" gnus-uu-post-news
- "om" gnus-summary-mail-forward
- "op" gnus-summary-post-forward
- "Om" gnus-uu-digest-mail-forward
- "Op" gnus-uu-digest-post-forward)
-
-(gnus-define-keys
- (gnus-send-bounce-map "D" gnus-summary-send-map)
- "b" gnus-summary-resend-bounced-mail
-; "c" gnus-summary-send-draft
- "r" gnus-summary-resend-message)
+(gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map)
+ "p" gnus-summary-post-news
+ "f" gnus-summary-followup
+ "F" gnus-summary-followup-with-original
+ "c" gnus-summary-cancel-article
+ "s" gnus-summary-supersede-article
+ "r" gnus-summary-reply
+ "R" gnus-summary-reply-with-original
+ "m" gnus-summary-mail-other-window
+ "u" gnus-uu-post-news
+ "\M-c" gnus-summary-mail-crosspost-complaint
+ "om" gnus-summary-mail-forward
+ "op" gnus-summary-post-forward
+ "Om" gnus-uu-digest-mail-forward
+ "Op" gnus-uu-digest-post-forward)
+
+(gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
+ "b" gnus-summary-resend-bounced-mail
+ ;; "c" gnus-summary-send-draft
+ "r" gnus-summary-resend-message)
;;; Internal functions.
,@forms
(gnus-inews-add-send-actions ,winconf ,buffer ,article)
(setq gnus-message-buffer (current-buffer))
+ (make-local-variable 'gnus-newsgroup-name)
(gnus-configure-windows ,config t))))
(defun gnus-inews-add-send-actions (winconf buffer article)
(gnus-summary-select-article nil nil nil article)
(gnus-summary-remove-process-mark article))
(gnus-copy-article-buffer)
+ (message-goto-body)
(let ((message-reply-buffer gnus-article-copy)
(message-reply-headers gnus-current-headers))
(message-yank-original)
(setq beg (or beg (mark t))))
(when articles (insert "\n")))
-
(push-mark)
(goto-char beg)))
article)
(while (setq article (pop articles))
(when (gnus-summary-select-article t nil nil article)
- (when (gnus-eval-in-buffer-window
- gnus-original-article-buffer (message-cancel-news))
+ (when (gnus-eval-in-buffer-window gnus-original-article-buffer
+ (message-cancel-news))
(gnus-summary-mark-as-read article gnus-canceled-mark)
(gnus-cache-remove-article 1))
(gnus-article-hide-headers-if-wanted))
(save-excursion
(set-buffer article-buffer)
(save-restriction
+ ;; Copy over the (displayed) article buffer, delete
+ ;; hidden text and remove text properties.
(widen)
- (setq contents (format "%s" (buffer-string)))
+ (copy-to-buffer gnus-article-copy (point-min) (point-max))
+ (set-buffer gnus-article-copy)
+ (article-delete-text-of-type 'annotation)
+ (insert
+ (prog1
+ (format "%s" (buffer-string))
+ (erase-buffer)))
+ ;; Find the original headers.
(set-buffer gnus-original-article-buffer)
(goto-char (point-min))
(while (looking-at message-unix-mail-delimiter)
(forward-line 1))
(setq beg (point))
(setq end (or (search-forward "\n\n" nil t) (point)))
+ ;; Delete the headers from the displayed articles.
(set-buffer gnus-article-copy)
- (erase-buffer)
- (insert contents)
(delete-region (goto-char (point-min))
(or (search-forward "\n\n" nil t) (point)))
- (insert-buffer-substring gnus-original-article-buffer beg end)))
+ ;; Insert the original article headers.
+ (insert-buffer-substring gnus-original-article-buffer beg end)
+ (article-decode-rfc1522)))
gnus-article-copy)))
(defun gnus-post-news (post &optional group header article-buffer yank subject
(if post
(message-news (or to-group group))
(set-buffer gnus-article-copy)
- (message-followup))
+ (message-followup to-group))
;; The is mail.
(if post
(progn
(cond
;; If the group-method is nil (which shouldn't happen) we use
;; the default method.
- ((null arg)
+ ((null group-method)
(or gnus-post-method gnus-select-method message-post-method))
;; We want this group's method.
((and arg (not (eq arg 0)))
(cons (or gnus-last-posting-server "") 0))))
method-alist))))
;; Override normal method.
- ((and gnus-post-method
- (or (gnus-method-option-p group-method 'post)
- (gnus-method-option-p group-method 'post-mail)))
+ (gnus-post-method
gnus-post-method)
- ;; Perhaps this is a mail group?
- ((and (not (gnus-member-of-valid 'post group))
- (not (gnus-method-option-p group-method 'post-mail)))
- group-method)
;; Use the normal select method.
(t gnus-select-method))))
gnus-inews-sent-ids))
(setcdr end nil))
(nnheader-temp-write gnus-sent-message-ids-file
- (prin1 `(setq gnus-inews-sent-ids ',gnus-inews-sent-ids)
- (current-buffer)))
+ (gnus-prin1 `(setq gnus-inews-sent-ids ',gnus-inews-sent-ids)))
nil)))))
\f
(format " %d.%d" emacs-major-version emacs-minor-version)))
(t emacs-version))))
-;; Written by "Mr. Per Persson" <pp@solace.mh.se>.
+;; Written by "Mr. Per Persson" <pp@gnu.ai.mit.edu>.
(defun gnus-inews-insert-mime-headers ()
(goto-char (point-min))
(let ((mail-header-separator
(gnus-summary-mail-forward t))
(defvar gnus-nastygram-message
- "The following article was inappropriately posted to %s.\n"
+ "The following article was inappropriately posted to %s.\n\n"
"Format string to insert in nastygrams.
The current group name will be inserted at \"%s\".")
(let ((group gnus-newsgroup-name))
(gnus-summary-reply-with-original n)
(set-buffer gnus-message-buffer)
+ (message-goto-body)
(insert (format gnus-nastygram-message group))
(message-send-and-exit))))
+(defun gnus-summary-mail-crosspost-complaint (n)
+ "Send a complaint about crossposting to the current article(s)."
+ (interactive "P")
+ (let ((articles (gnus-summary-work-articles n))
+ article)
+ (while (setq article (pop articles))
+ (set-buffer gnus-summary-buffer)
+ (gnus-summary-goto-subject article)
+ (let ((group (gnus-group-real-name gnus-newsgroup-name))
+ newsgroups followup-to)
+ (gnus-summary-select-article)
+ (set-buffer gnus-original-article-buffer)
+ (if (and (<= (length (message-tokenize-header
+ (setq newsgroups (mail-fetch-field "newsgroups"))
+ ", "))
+ 1)
+ (or (not (setq followup-to (mail-fetch-field "followup-to")))
+ (not (member group (message-tokenize-header
+ followup-to ", ")))))
+ (if followup-to
+ (gnus-message 1 "Followup-to restricted")
+ (gnus-message 1 "Not a crossposted article"))
+ (set-buffer gnus-summary-buffer)
+ (gnus-summary-reply-with-original 1)
+ (set-buffer gnus-message-buffer)
+ (message-goto-body)
+ (insert (format gnus-crosspost-complaint newsgroups group))
+ (when (gnus-y-or-n-p "Send this complaint? ")
+ (message-send-and-exit)))))))
+
(defun gnus-summary-mail-other-window ()
"Compose mail in other window."
(interactive)
(kill-buffer "*Gnus Help Bug*")))
(defun gnus-debug ()
- "Attemps to go through the Gnus source file and report what variables have been changed.
+ "Attempts to go through the Gnus source file and report what variables have been changed.
The source file has to be in the Emacs load path."
(interactive)
(let ((files '("gnus-load.el" "gnus-sum.el" "gnus-group.el"
"gnus-art.el" "gnus-start.el"
- "gnus-msg.el" "gnus-score.el"
+ "gnus-msg.el" "gnus-score.el" "gnus-win.el"
"nnmail.el" "message.el"))
- file dirs expr olist sym)
+ file expr olist sym)
(gnus-message 4 "Please wait while we snoop your variables...")
(sit-for 0)
+ ;; Go through all the files looking for non-default values for variables.
(save-excursion
(set-buffer (get-buffer-create " *gnus bug info*"))
(buffer-disable-undo (current-buffer))
(while files
(erase-buffer)
- (setq dirs load-path)
- (while dirs
- (if (or (not (car dirs))
- (not (stringp (car dirs)))
- (not (file-exists-p
- (setq file (concat (file-name-as-directory
- (car dirs)) (car files))))))
- (setq dirs (cdr dirs))
- (setq dirs nil)
- (insert-file-contents file)
+ (when (file-exists-p (setq file (locate-library (pop files))))
+ (insert-file-contents file)
+ (goto-char (point-min))
+ (if (not (re-search-forward "^;;* *Internal variables" nil t))
+ (gnus-message 4 "Malformed sources in file %s" file)
+ (narrow-to-region (point-min) (point))
(goto-char (point-min))
- (if (not (re-search-forward "^;;* *Internal variables" nil t))
- (gnus-message 4 "Malformed sources in file %s" file)
- (narrow-to-region (point-min) (point))
- (goto-char (point-min))
- (while (setq expr (condition-case ()
- (read (current-buffer)) (error nil)))
- (condition-case ()
- (and (eq (car expr) 'defvar)
- (stringp (nth 3 expr))
- (or (not (boundp (nth 1 expr)))
- (not (equal (eval (nth 2 expr))
- (symbol-value (nth 1 expr)))))
- (setq olist (cons (nth 1 expr) olist)))
- (error nil))))))
- (setq files (cdr files)))
+ (while (setq expr (condition-case ()
+ (read (current-buffer)) (error nil)))
+ (condition-case ()
+ (and (eq (car expr) 'defvar)
+ (stringp (nth 3 expr))
+ (or (not (boundp (nth 1 expr)))
+ (not (equal (eval (nth 2 expr))
+ (symbol-value (nth 1 expr)))))
+ (push (nth 1 expr) olist))
+ (error nil))))))
(kill-buffer (current-buffer)))
(when (setq olist (nreverse olist))
(insert "------------------ Environment follows ------------------\n\n"))
(setq olist (cdr olist)))
(insert "\n\n")
;; Remove any null chars - they seem to cause trouble for some
- ;; mailers. (Byte-compiled output from the stuff above.)
+ ;; mailers. (Byte-compiled output from the stuff above.)
(goto-char (point-min))
(while (re-search-forward "[\000\200]" nil t)
(replace-match "" t t))))
(insert "Gcc: ")
(if (and gnus-newsgroup-name
(setq gcc-self-val
- (gnus-group-get-parameter
+ (gnus-group-find-parameter
gnus-newsgroup-name 'gcc-self)))
(progn
(insert