comparison lisp/mail/rnewspost.el @ 21174:17ad035e0cab

(news-inews): Signal error if inews fails.
author Richard M. Stallman <rms@gnu.org>
date Sat, 14 Mar 1998 08:16:52 +0000
parents 11218164bc54
children 1afd18de6c50
comparison
equal deleted inserted replaced
21173:e917eb0d4e01 21174:17ad035e0cab
269 (goto-char (point-max)) 269 (goto-char (point-max))
270 ;; require a newline at the end for inews to append .signature to 270 ;; require a newline at the end for inews to append .signature to
271 (or (= (preceding-char) ?\n) 271 (or (= (preceding-char) ?\n)
272 (insert ?\n)) 272 (insert ?\n))
273 (message "Posting to USENET...") 273 (message "Posting to USENET...")
274 (call-process-region (point-min) (point-max) 274 (unwind-protect
275 news-inews-program nil 0 nil 275 (if (not (eq 0
276 "-h") ; take all header lines! 276 (call-process-region (point-min) (point-max)
277 ;@@ setting of subject and newsgroups still needed? 277 news-inews-program nil 0 nil
278 ;"-t" subject 278 "-h"))) ; take all header lines!
279 ;"-n" newsgroups 279 ;@@ setting of subject and newsgroups still needed?
280 (message "Posting to USENET... done") 280 ;"-t" subject
281 (goto-char (point-min)) ;restore internal header separator 281 ;"-n" newsgroups
282 (search-forward "\n\n") 282 (error "Posting to USENET failed")
283 (replace-match (concat "\n" mail-header-separator "\n")) 283 (message "Posting to USENET... done"))
284 (set-buffer-modified-p nil)) 284 (goto-char (point-min)) ;restore internal header separator
285 (and (fboundp 'bury-buffer) (bury-buffer)))) 285 (search-forward "\n\n")
286 (replace-match (concat "\n" mail-header-separator "\n"))
287 (set-buffer-modified-p nil)))
288 (bury-buffer)))
286 289
287 ;@@ shares some code with news-reply and news-post-news 290 ;@@ shares some code with news-reply and news-post-news
288 (defun news-mail-reply () 291 (defun news-mail-reply ()
289 "Mail a reply to the author of the current article. 292 "Mail a reply to the author of the current article.
290 While composing the reply, use \\[news-reply-yank-original] to yank the 293 While composing the reply, use \\[news-reply-yank-original] to yank the