]> git.eshelyaron.com Git - emacs.git/commitdiff
(news-inews): Signal error if inews fails.
authorRichard M. Stallman <rms@gnu.org>
Sat, 14 Mar 1998 08:16:52 +0000 (08:16 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 14 Mar 1998 08:16:52 +0000 (08:16 +0000)
lisp/mail/rnewspost.el

index 2c8da70dbcb3c878daca8a598e5716f9c3a93254..cffc2fb03dcfe55cbd42d72371cc45a06f342b22 100644 (file)
@@ -271,18 +271,21 @@ summary (abstract) of the message."
       (or (= (preceding-char) ?\n)
          (insert ?\n))
       (message "Posting to USENET...")
-      (call-process-region (point-min) (point-max) 
-                          news-inews-program nil 0 nil
-                          "-h")        ; take all header lines!
-                          ;@@ setting of subject and newsgroups still needed?
-                          ;"-t" subject
-                          ;"-n" newsgroups
-      (message "Posting to USENET... done")
-      (goto-char (point-min))          ;restore internal header separator
-      (search-forward "\n\n")
-      (replace-match (concat "\n" mail-header-separator "\n"))
-      (set-buffer-modified-p nil))
-    (and (fboundp 'bury-buffer) (bury-buffer))))
+      (unwind-protect
+         (if (not (eq 0 
+                      (call-process-region (point-min) (point-max) 
+                                           news-inews-program nil 0 nil
+                                           "-h"))) ; take all header lines!
+                                       ;@@ setting of subject and newsgroups still needed?
+                                       ;"-t" subject
+                                       ;"-n" newsgroups
+             (error "Posting to USENET failed")
+           (message "Posting to USENET... done"))
+       (goto-char (point-min))         ;restore internal header separator
+       (search-forward "\n\n")
+       (replace-match (concat "\n" mail-header-separator "\n"))
+       (set-buffer-modified-p nil)))
+    (bury-buffer)))
 
 ;@@ shares some code with news-reply and news-post-news
 (defun news-mail-reply ()