Function: run-network-program

run-network-program is a byte-compiled function defined in net-utils.el.gz.

Signature

(run-network-program PROCESS-NAME HOST PORT &optional INITIAL-STRING)

Source Code

;; Defined in /usr/src/emacs/lisp/net/net-utils.el.gz
;; Workhorse routine
(defun run-network-program (process-name host port &optional initial-string)
  (let ((tcp-connection)
	(buf))
    (setq buf (get-buffer-create (concat "*" process-name "*")))
    (set-buffer buf)
    (or
     (setq tcp-connection
	   (open-network-stream process-name buf host port))
     (error "Could not open connection to %s" host))
    (erase-buffer)
    (set-marker (process-mark tcp-connection) (point-min))
    (set-process-filter tcp-connection #'net-utils-remove-ctrl-m-filter)
    (and initial-string
	 (process-send-string tcp-connection
			      (concat initial-string "\r\n")))
    (display-buffer buf)))