Function: nnspool-request-post

nnspool-request-post is a byte-compiled function defined in nnspool.el.gz.

Signature

(nnspool-request-post &optional SERVER)

Documentation

Post a new news in current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnspool.el.gz
(deffoo nnspool-request-post (&optional _server)
  "Post a new news in current buffer."
  (save-excursion
    (let* ((process-connection-type nil) ; t bugs out on Solaris
	   (inews-buffer (generate-new-buffer " *nnspool post*"))
	   (buf (current-buffer))
	   (proc
	    (condition-case err
		(apply #'start-process "*nnspool inews*" inews-buffer
		       nnspool-inews-program nnspool-inews-switches)
	      (error
	       (nnheader-report 'nnspool "inews error: %S" err)))))
      (if (not proc)
	  ;; The inews program failed.
	  ()
	(nnheader-report 'nnspool "")
	(set-process-sentinel proc 'nnspool-inews-sentinel)
	(with-temp-buffer
	  (set-buffer-multibyte nil)
	  (insert-buffer-substring buf)
	  (encode-coding-region (point-min) (point-max)
				nnspool-file-coding-system)
	  (process-send-region proc (point-min) (point-max)))
	;; We slap a condition-case around this, because the process may
	;; have exited already...
	(ignore-errors
	  (process-send-eof proc))
	t))))