Function: nntp-service-to-port

nntp-service-to-port is a byte-compiled function defined in nntp.el.gz.

Signature

(nntp-service-to-port SVC)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nntp.el.gz
(defun nntp-service-to-port (svc)
  (cond
   ((integerp svc) (number-to-string svc))
   ((string-match "\\`[0-9]+\\'" svc) svc)
   (t
    (with-temp-buffer
      (ignore-errors (insert-file-contents "/etc/services"))
      (goto-char (point-min))
      (if (re-search-forward (concat "^" (regexp-quote svc)
                                     "[ \t]+\\([0-9]+\\)/tcp"))
          (match-string 1)
        svc)))))