diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-07-03 22:16:34 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-07-03 22:16:34 +0000 |
commit | e026ffd4266d6f9b4fe863b640a78c166535d1c6 (patch) | |
tree | 55133fe1bf42517e632f8a9c76e896ae63d9bd63 /lisp/=gnuspost.el | |
parent | 6970f00289a00ddd8a4c98f7a111e50fd1ddeb54 (diff) | |
download | emacs-e026ffd4266d6f9b4fe863b640a78c166535d1c6.tar.gz |
(gnus-inews-news): Allow newsgroups to be separated
by spaces or commas and spaces.
Diffstat (limited to 'lisp/=gnuspost.el')
-rw-r--r-- | lisp/=gnuspost.el | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/lisp/=gnuspost.el b/lisp/=gnuspost.el index ea2a0c97ee6..a19e850ba5d 100644 --- a/lisp/=gnuspost.el +++ b/lisp/=gnuspost.el @@ -353,24 +353,43 @@ original message into it." (widen) (goto-char (point-min)) (run-hooks 'news-inews-hook) - ;; Mail the message too if To: or Cc: exists. - (if (save-restriction - (narrow-to-region - (point-min) - (progn + (save-restriction + (narrow-to-region + (point-min) + (progn + (goto-char (point-min)) + (search-forward (concat "\n" mail-header-separator "\n")) + (point))) + + ;; Correct newsgroups field: change sequence of spaces to comma and + ;; eliminate spaces around commas. Eliminate imbedded line breaks. + (goto-char (point-min)) + (if (search-forward-regexp "^Newsgroups: +" nil t) + (save-restriction + (narrow-to-region + (point) + (if (re-search-forward "^[^ \t]" nil 'end) + (match-beginning 0) + (point-max))) (goto-char (point-min)) - (search-forward (concat "\n" mail-header-separator "\n")) - (point))) - (or (mail-fetch-field "to" nil t) - (mail-fetch-field "cc" nil t))) - (if gnus-mail-send-method - (progn - (message "Sending via mail...") - (funcall gnus-mail-send-method) - (message "Sending via mail... done")) - (ding) - (message "No mailer defined. To: and/or Cc: fields ignored.") - (sit-for 1))) + (replace-regexp "\n[ \t]+" " ") ;No line breaks (too confusing) + (goto-char (point-min)) + (replace-regexp "[ \t\n]*,[ \t\n]*\\|[ \t]+" ",") + )) + + ;; Mail the message too if To: or Cc: exists. + (if (or (mail-fetch-field "to" nil t) + (mail-fetch-field "cc" nil t)) + (if gnus-mail-send-method + (progn + (message "Sending via mail...") + (widen) + (funcall gnus-mail-send-method) + (message "Sending via mail... done")) + (ding) + (message "No mailer defined. To: and/or Cc: fields ignored.") + (sit-for 1)))) + ;; Send to NNTP server. (message "Posting to USENET...") (if (gnus-inews-article) |