aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-03 22:16:34 +0000
committerRichard M. Stallman1994-07-03 22:16:34 +0000
commit738f9104db739f70c5fd33da39c92bca27cb809d (patch)
treefbfeb2451ae92433b0e60e44b4af75c75dcd5f34
parent2c5adf7ee3e5886176798722d19629ecc9428aa3 (diff)
downloademacs-738f9104db739f70c5fd33da39c92bca27cb809d.tar.gz
emacs-738f9104db739f70c5fd33da39c92bca27cb809d.zip
(gnus-inews-news): Allow newsgroups to be separated
by spaces or commas and spaces.
-rw-r--r--lisp/gnuspost.el53
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."
353 (widen) 353 (widen)
354 (goto-char (point-min)) 354 (goto-char (point-min))
355 (run-hooks 'news-inews-hook) 355 (run-hooks 'news-inews-hook)
356 ;; Mail the message too if To: or Cc: exists. 356 (save-restriction
357 (if (save-restriction 357 (narrow-to-region
358 (narrow-to-region 358 (point-min)
359 (point-min) 359 (progn
360 (progn 360 (goto-char (point-min))
361 (search-forward (concat "\n" mail-header-separator "\n"))
362 (point)))
363
364 ;; Correct newsgroups field: change sequence of spaces to comma and
365 ;; eliminate spaces around commas. Eliminate imbedded line breaks.
366 (goto-char (point-min))
367 (if (search-forward-regexp "^Newsgroups: +" nil t)
368 (save-restriction
369 (narrow-to-region
370 (point)
371 (if (re-search-forward "^[^ \t]" nil 'end)
372 (match-beginning 0)
373 (point-max)))
361 (goto-char (point-min)) 374 (goto-char (point-min))
362 (search-forward (concat "\n" mail-header-separator "\n")) 375 (replace-regexp "\n[ \t]+" " ") ;No line breaks (too confusing)
363 (point))) 376 (goto-char (point-min))
364 (or (mail-fetch-field "to" nil t) 377 (replace-regexp "[ \t\n]*,[ \t\n]*\\|[ \t]+" ",")
365 (mail-fetch-field "cc" nil t))) 378 ))
366 (if gnus-mail-send-method 379
367 (progn 380 ;; Mail the message too if To: or Cc: exists.
368 (message "Sending via mail...") 381 (if (or (mail-fetch-field "to" nil t)
369 (funcall gnus-mail-send-method) 382 (mail-fetch-field "cc" nil t))
370 (message "Sending via mail... done")) 383 (if gnus-mail-send-method
371 (ding) 384 (progn
372 (message "No mailer defined. To: and/or Cc: fields ignored.") 385 (message "Sending via mail...")
373 (sit-for 1))) 386 (widen)
387 (funcall gnus-mail-send-method)
388 (message "Sending via mail... done"))
389 (ding)
390 (message "No mailer defined. To: and/or Cc: fields ignored.")
391 (sit-for 1))))
392
374 ;; Send to NNTP server. 393 ;; Send to NNTP server.
375 (message "Posting to USENET...") 394 (message "Posting to USENET...")
376 (if (gnus-inews-article) 395 (if (gnus-inews-article)